]> granicus.if.org Git - python/commitdiff
Merged revisions 85090 via svnmerge from
authorVictor Stinner <victor.stinner@haypocalc.com>
Wed, 29 Sep 2010 01:31:23 +0000 (01:31 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Wed, 29 Sep 2010 01:31:23 +0000 (01:31 +0000)
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.
........

Lib/linecache.py

index f0bb83d1d80e26f1ea10740a6d965633b674acb7..974b1d965ab500ff46b10ac5378e5fa8a0400ffe 100644 (file)
@@ -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