From ee555ff09dc12688dee5f8986a5eb19cf3e5dbbe Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Thu, 29 Oct 2015 22:18:59 +0100 Subject: [PATCH] compat: Replace intern() with compat.intern() --- mopidy/compat.py | 2 ++ mopidy/models/fields.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mopidy/compat.py b/mopidy/compat.py index 5df43e74..97531df7 100644 --- a/mopidy/compat.py +++ b/mopidy/compat.py @@ -34,6 +34,7 @@ if PY2: text_type = unicode input = raw_input + intern = intern def itervalues(dct, **kwargs): return iter(dct.itervalues(**kwargs)) @@ -49,6 +50,7 @@ else: text_type = str input = input + intern = sys.intern def itervalues(dct, **kwargs): return iter(dct.values(**kwargs)) diff --git a/mopidy/models/fields.py b/mopidy/models/fields.py index 91cd2cad..c686b447 100644 --- a/mopidy/models/fields.py +++ b/mopidy/models/fields.py @@ -95,7 +95,7 @@ class Identifier(String): :param default: default value for field """ def validate(self, value): - return intern(str(super(Identifier, self).validate(value))) + return compat.intern(str(super(Identifier, self).validate(value))) class URI(Identifier):