[Python-3000-checkins] r56233 - python/branches/py3k-struni/Lib/linecache.py

guido.van.rossum python-3000-checkins at python.org
Tue Jul 10 13:34:32 CEST 2007


Author: guido.van.rossum
Date: Tue Jul 10 13:34:31 2007
New Revision: 56233

Modified:
   python/branches/py3k-struni/Lib/linecache.py
Log:
Be even more lenient when catching errors from readlines().


Modified: python/branches/py3k-struni/Lib/linecache.py
==============================================================================
--- python/branches/py3k-struni/Lib/linecache.py	(original)
+++ python/branches/py3k-struni/Lib/linecache.py	Tue Jul 10 13:34:31 2007
@@ -125,11 +125,12 @@
             # No luck
 ##          print '*** Cannot stat', filename, ':', msg
             return []
+##  print("Refreshing cache for %s..." % fullname)
     try:
         fp = open(fullname, 'rU')
         lines = fp.readlines()
         fp.close()
-    except IOError as msg:
+    except Exception as msg:
 ##      print '*** Cannot open', fullname, ':', msg
         return []
     coding = "utf-8"


More information about the Python-3000-checkins mailing list