reached through a symlink (was comparing path of module to path to function and
were not matching because of the symlink). os.path.realpath() is now used to
solve this discrepency.
Closes bug #570300. Thanks Johannes Gijsbers for the fix.
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__']
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