]> granicus.if.org Git - python/commitdiff
Be even more lenient when catching errors from readlines().
authorGuido van Rossum <guido@python.org>
Tue, 10 Jul 2007 11:34:31 +0000 (11:34 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 10 Jul 2007 11:34:31 +0000 (11:34 +0000)
Lib/linecache.py

index 77e3ab7197061d877b43c79c4eda7d1be7f1f0a3..90b864634694f42e9fb86f78120066821be97c51 100644 (file)
@@ -125,11 +125,12 @@ def updatecache(filename, module_globals=None):
             # 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"