Commit 24f3c5c6 authored by Amaury Forgeot d'Arc's avatar Amaury Forgeot d'Arc

Prevent an error when inspect.isabstract() is called with something else than a new-style class.

parent 4b798bdf
......@@ -247,7 +247,7 @@ def isgenerator(object):
def isabstract(object):
"""Return true if the object is an abstract base class (ABC)."""
return object.__flags__ & TPFLAGS_IS_ABSTRACT
return isinstance(object, type) and object.__flags__ & TPFLAGS_IS_ABSTRACT
def getmembers(object, predicate=None):
"""Return all members of an object as (name, value) pairs sorted by name.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment