diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-09-29 01:26:06 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-09-29 01:26:06 (GMT) |
commit | 35c52240ddaf815759b568dfcf3cc9f11aae8246 (patch) | |
tree | 3f19624a5a75e652af3ec118689f07c3e0a30f27 /Lib/linecache.py | |
parent | 6ec5ed22b2e5b4429ad9e130ecaad7fa16fde691 (diff) | |
download | cpython-35c52240ddaf815759b568dfcf3cc9f11aae8246.zip cpython-35c52240ddaf815759b568dfcf3cc9f11aae8246.tar.gz cpython-35c52240ddaf815759b568dfcf3cc9f11aae8246.tar.bz2 |
Merged revisions 85088 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r85088 | victor.stinner | 2010-09-29 03:24:59 +0200 (mer., 29 sept. 2010) | 4 lines
linecache.updatecache() returns an empty list on error
lines variable was not set on IOError
........
Diffstat (limited to 'Lib/linecache.py')
-rw-r--r-- | Lib/linecache.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/linecache.py b/Lib/linecache.py index ef2adf5..f0bb83d 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: - pass + lines = [] if lines and not lines[-1].endswith('\n'): lines[-1] += '\n' size, mtime = stat.st_size, stat.st_mtime |