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):