diff --git a/linecache.py b/linecache.py index 4838625..d5bcc47 100644 --- a/linecache.py +++ b/linecache.py @@ -79,6 +79,9 @@ def updatecache(filename, module_globals=None): try: stat = os.stat(fullname) except os.error, msg: + if os.path.isabs(filename): + return [] + basename = os.path.split(filename)[1] # Try for a __loader__, if available @@ -110,7 +113,7 @@ def updatecache(filename, module_globals=None): # When using imputil, sys.path may contain things other than # strings; ignore them when it happens. try: - fullname = os.path.join(dirname, basename) + fullname = os.path.join(dirname, filename) except (TypeError, AttributeError): # Not sufficiently string-like to do anything useful with. pass