Index: linecache.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/linecache.py,v retrieving revision 1.13 diff -u -r1.13 linecache.py *** linecache.py 26 Oct 2004 09:16:41 -0000 1.13 --- linecache.py 30 Sep 2005 15:02:54 -0000 *************** *** 1,8 **** """Cache lines from files. - - This is intended to read lines from modules imported -- hence if a filename - is not found, it will look down the module search path for a file by - that name. """ import sys --- 1,4 ---- *************** *** 76,101 **** try: stat = os.stat(fullname) except os.error, msg: ! # Try looking through the module search path. ! basename = os.path.split(filename)[1] ! for dirname in sys.path: ! # When using imputil, sys.path may contain things other than ! # strings; ignore them when it happens. ! try: ! fullname = os.path.join(dirname, basename) ! except (TypeError, AttributeError): ! # Not sufficiently string-like to do anything useful with. ! pass ! else: ! try: ! stat = os.stat(fullname) ! break ! except os.error: ! pass ! else: ! # No luck ! ## print '*** Cannot stat', filename, ':', msg ! return [] try: fp = open(fullname, 'rU') lines = fp.readlines() --- 72,78 ---- try: stat = os.stat(fullname) except os.error, msg: ! return [] try: fp = open(fullname, 'rU') lines = fp.readlines()