diff options
author | Phillip J. Eby <pje@telecommunity.com> | 2006-07-20 15:54:16 (GMT) |
---|---|---|
committer | Phillip J. Eby <pje@telecommunity.com> | 2006-07-20 15:54:16 (GMT) |
commit | 1a2959cfa80f43d9a250e6b7ee39cee51b7e8a57 (patch) | |
tree | e68d1afd6c7b38349d973a358dfe463de19153a4 /Lib/inspect.py | |
parent | cfe3128cd58c4a59d236527184b40352ae35e44a (diff) | |
download | cpython-1a2959cfa80f43d9a250e6b7ee39cee51b7e8a57.zip cpython-1a2959cfa80f43d9a250e6b7ee39cee51b7e8a57.tar.gz cpython-1a2959cfa80f43d9a250e6b7ee39cee51b7e8a57.tar.bz2 |
Fix SF#1516184 (again) and add a test to prevent regression.
(There was a problem with empty filenames still causing recursion)
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index 311fe7e..dc2fa08 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -364,8 +364,9 @@ def getabsfile(object, _filename=None): The idea is for each object to have a unique origin, so this routine normalizes the result as much as possible.""" - return os.path.normcase( - os.path.abspath(_filename or getsourcefile(object) or getfile(object))) + if _filename is None: + _filename = getsourcefile(object) or getfile(object) + return os.path.normcase(os.path.abspath(_filename)) modulesbyfile = {} |