summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-09-29 01:31:23 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-09-29 01:31:23 (GMT)
commit6e4dc80201afa259e44f410f8d7247a49468b4e8 (patch)
tree15b38b242eab0e674108259e98e5472b449a5bb2
parent35c52240ddaf815759b568dfcf3cc9f11aae8246 (diff)
downloadcpython-6e4dc80201afa259e44f410f8d7247a49468b4e8.zip
cpython-6e4dc80201afa259e44f410f8d7247a49468b4e8.tar.gz
cpython-6e4dc80201afa259e44f410f8d7247a49468b4e8.tar.bz2
Merged revisions 85090 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85090 | victor.stinner | 2010-09-29 03:30:45 +0200 (mer., 29 sept. 2010) | 4 lines linecache.updatecache(): don't the lines into the cache on IOError Use the same behaviour than Python 2.7. ........
-rw-r--r--Lib/linecache.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/linecache.py b/Lib/linecache.py
index f0bb83d..974b1d9 100644
--- a/Lib/linecache.py
+++ b/Lib/linecache.py
@@ -128,7 +128,7 @@ def updatecache(filename, module_globals=None):
with open(fullname, 'r', encoding=coding) as fp:
lines = fp.readlines()
except IOError:
- lines = []
+ return []
if lines and not lines[-1].endswith('\n'):
lines[-1] += '\n'
size, mtime = stat.st_size, stat.st_mtime