diff options
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index 12c9cb7..7f73264 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -380,7 +380,9 @@ def getmodule(object): return sys.modules.get(modulesbyfile[file]) for module in sys.modules.values(): if hasattr(module, '__file__'): - modulesbyfile[getabsfile(module)] = module.__name__ + modulesbyfile[ + os.path.realpath( + getabsfile(module))] = module.__name__ if file in modulesbyfile: return sys.modules.get(modulesbyfile[file]) main = sys.modules['__main__'] |