diff options
| author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-08 21:51:57 (GMT) |
|---|---|---|
| committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-08 21:51:57 (GMT) |
| commit | 24f3c5c646d26350e4de6a878fed3e6db1e4ff9a (patch) | |
| tree | 38d19136d56f62e688e97d8f6d592fa9ad831512 /Lib/inspect.py | |
| parent | 4b798bdf8ab3a4a4b3b11ea60a8f0b1c54e43224 (diff) | |
| download | cpython-24f3c5c646d26350e4de6a878fed3e6db1e4ff9a.zip cpython-24f3c5c646d26350e4de6a878fed3e6db1e4ff9a.tar.gz cpython-24f3c5c646d26350e4de6a878fed3e6db1e4ff9a.tar.bz2 | |
Prevent an error when inspect.isabstract() is called with something else than a new-style class.
Diffstat (limited to 'Lib/inspect.py')
| -rw-r--r-- | Lib/inspect.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index 3f9199f..b492514 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -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. |
