summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/inspect.py4
-rw-r--r--Misc/NEWS4
2 files changed, 7 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__']
diff --git a/Misc/NEWS b/Misc/NEWS
index c1c7867..9ee0449 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -41,6 +41,10 @@ Extension modules
Library
-------
+- bug #570300: Fix inspect to resolve file locations using os.path.realpath()
+ so as to properly list all functions in a module when the module itself is
+ reached through a symlink. Thanks Johannes Gijsbers.
+
- doctest refactoring continued. See the docs for details. As part of
this effort, some old and little- (never?) used features are now
deprecated: the Tester class, the module is_private() function, and the