[Python-checkins] r85088 - python/branches/py3k/Lib/linecache.py

victor.stinner python-checkins at python.org
Wed Sep 29 03:24:59 CEST 2010


Author: victor.stinner
Date: Wed Sep 29 03:24:59 2010
New Revision: 85088
Log:
linecache.updatecache() returns an empty list on error
lines variable was not set on IOError
Modified:
 python/branches/py3k/Lib/linecache.py
Modified: python/branches/py3k/Lib/linecache.py
==============================================================================
--- python/branches/py3k/Lib/linecache.py	(original)
+++ python/branches/py3k/Lib/linecache.py	Wed Sep 29 03:24:59 2010
@@ -128,7 +128,7 @@
 with open(fullname, 'r', encoding=coding) as fp:
 lines = fp.readlines()
 except IOError:
- pass
+ lines = []
 if lines and not lines[-1].endswith('\n'):
 lines[-1] += '\n'
 size, mtime = stat.st_size, stat.st_mtime


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /