From: Guido van Rossum Date: Tue, 10 Jul 2007 11:34:31 +0000 (+0000) Subject: Be even more lenient when catching errors from readlines(). X-Git-Tag: v3.0a1~713 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d10b2dc4fc7d0c37b6d835c861c1d112ea0cbafb;p=python Be even more lenient when catching errors from readlines(). --- diff --git a/Lib/linecache.py b/Lib/linecache.py index 77e3ab7197..90b8646346 100644 --- a/Lib/linecache.py +++ b/Lib/linecache.py @@ -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"