summaryrefslogtreecommitdiffstats
path: root/Lib/linecache.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-05-05 08:31:54 (GMT)
committerGeorg Brandl <georg@python.org>2009-05-05 08:31:54 (GMT)
commit991f9202bede42b033e499525755daed4a1c07be (patch)
tree84c34a12737228ad6109c46f42c86676c4a1c480 /Lib/linecache.py
parenteaa84ef1e96f1f597ef54f40147de2e6a6980e34 (diff)
downloadcpython-991f9202bede42b033e499525755daed4a1c07be.zip
cpython-991f9202bede42b033e499525755daed4a1c07be.tar.gz
cpython-991f9202bede42b033e499525755daed4a1c07be.tar.bz2
Merged revisions 72319-72320 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72319 | georg.brandl | 2009-05-05 10:28:49 +0200 (Di, 05 Mai 2009) | 1 line #1309567: fix linecache behavior of stripping subdirectories from paths when looking for relative filename matches. Also add a linecache test suite. ........ r72320 | georg.brandl | 2009-05-05 10:30:28 +0200 (Di, 05 Mai 2009) | 1 line Add a news entry for r72319. ........
Diffstat (limited to 'Lib/linecache.py')
-rw-r--r--Lib/linecache.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/linecache.py b/Lib/linecache.py
index 51404e2..27883fde 100644
--- a/Lib/linecache.py
+++ b/Lib/linecache.py
@@ -80,7 +80,7 @@ def updatecache(filename, module_globals=None):
try:
stat = os.stat(fullname)
except os.error as msg:
- basename = os.path.split(filename)[1]
+ basename = filename
# Try for a __loader__, if available
if module_globals and '__loader__' in module_globals:
@@ -104,7 +104,10 @@ def updatecache(filename, module_globals=None):
)
return cache[filename][2]
- # Try looking through the module search path.
+ # Try looking through the module search path, which is only useful
+ # when handling a relative filename.
+ if os.path.isabs(filename):
+ return []
for dirname in sys.path:
try: