diff options
-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 3c47cd9..5e3f7e2 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -370,7 +370,7 @@ def getmodule(object): """Return the module an object was defined in, or None if not found.""" if ismodule(object): return object - if isclass(object): + if hasattr(object, '__module__'): return sys.modules.get(object.__module__) try: file = getabsfile(object) |