Kaydet (Commit) 41a64a53 authored tarafından Victor Stinner's avatar Victor Stinner

linecache.updatecache(): don't the lines into the cache on IOError

Use the same behaviour than Python 2.7.
üst 78f43a73
......@@ -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
......
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