Kaydet (Commit) 6e4dc802 authored tarafından Victor Stinner's avatar Victor Stinner

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.
........
üst 35c52240
...@@ -128,7 +128,7 @@ def updatecache(filename, module_globals=None): ...@@ -128,7 +128,7 @@ def updatecache(filename, module_globals=None):
with open(fullname, 'r', encoding=coding) as fp: with open(fullname, 'r', encoding=coding) as fp:
lines = fp.readlines() lines = fp.readlines()
except IOError: except IOError:
lines = [] return []
if lines and not lines[-1].endswith('\n'): if lines and not lines[-1].endswith('\n'):
lines[-1] += '\n' lines[-1] += '\n'
size, mtime = stat.st_size, stat.st_mtime size, mtime = stat.st_size, stat.st_mtime
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment