diff --git a/mopidy/models.py b/mopidy/models.py index 03f991ab..f4404fb8 100644 --- a/mopidy/models.py +++ b/mopidy/models.py @@ -150,9 +150,8 @@ class ImmutableObjectMeta(type): attrs['_instances'] = weakref.WeakValueDictionary() attrs['__slots__'] = ['_hash'] + fields.values() - anncestors = [b for base in bases for b in inspect.getmro(base)] - for anncestor in anncestors: - if '__weakref__' in getattr(anncestor, '__slots__', []): + for ancestor in [b for base in bases for b in inspect.getmro(base)]: + if '__weakref__' in getattr(ancestor, '__slots__', []): break else: attrs['__slots__'].append('__weakref__') diff --git a/tests/models/test_models.py b/tests/models/test_models.py index 27d02382..c9c91ba1 100644 --- a/tests/models/test_models.py +++ b/tests/models/test_models.py @@ -8,7 +8,7 @@ from mopidy.models import ( TlTrack, Track, model_json_decoder) -class InheritanecTest(unittest.TestCase): +class InheritanceTest(unittest.TestCase): def test_weakref_and_slots_play_nice_in_subclass(self): # Check that the following does not happen: