Fix regression in 0.13 that breaks old-style classes

This is causing crashes with other (unrelated) classes that are old-style.
This commit is contained in:
Jozef 2017-03-09 09:33:28 +01:00 committed by jab
parent 0bee32a6fc
commit 97f59b96a2
1 changed files with 5 additions and 1 deletions

View File

@ -43,7 +43,11 @@ class BidirectionalMapping(Mapping):
Causes conforming classes to be virtual subclasses automatically.
"""
if cls is BidirectionalMapping:
mro = C.__mro__
try:
mro = C.__mro__
except AttributeError:
# Old-style classes in Python 2.7 do not have the __mro__ attribute!
return False
return all(any(B.__dict__.get(i) for B in mro) for i in cls._subclsattrs)
return NotImplemented