diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-01-17 22:27:54 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-01-17 22:27:54 +0000 |
commit | 5e5fbb612d8109078c2777e1759277f9144616d0 (patch) | |
tree | 31cc5456eb32eb87d987bcdaea2a91a090947bf7 /Lib/inspect.py | |
parent | 59ce042766d95a1471b08241038b8e0f4a65743a (diff) | |
download | cpython-git-5e5fbb612d8109078c2777e1759277f9144616d0.tar.gz |
fix inspect.isclass() on instances with a custom __getattr__ #1225107
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 a89d62e6a2..1453f3b7cf 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -62,7 +62,7 @@ def isclass(object): Class objects provide these attributes: __doc__ documentation string __module__ name of module in which this class was defined""" - return isinstance(object, types.ClassType) or hasattr(object, '__bases__') + return isinstance(object, (type, types.ClassType)) def ismethod(object): """Return true if the object is an instance method. |