summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/inspect.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index f62167b..c358a5c 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -173,7 +173,7 @@ def getfile(object):
return object.__file__
raise TypeError, 'arg is a built-in module'
if isclass(object):
- object = sys.modules[object.__module__]
+ object = sys.modules.get(object.__module__)
if hasattr(object, '__file__'):
return object.__file__
raise TypeError, 'arg is a built-in class'