Issue #23572: Fixed functools.singledispatch on classes with falsy metaclasses.

Patch by Ethan Furman.
This commit is contained in:
Yury Selivanov 2015-08-18 14:30:15 -04:00
parent a78ebe6323
commit ab7cc7598a
3 changed files with 22 additions and 1 deletions

View file

@ -551,7 +551,7 @@ def _c3_merge(sequences):
break # reject the current head, it appears later
else:
break
if not candidate:
if candidate is None:
raise RuntimeError("Inconsistent hierarchy")
result.append(candidate)
# remove the chosen candidate