diff options
author | shadchin <shadchin@yandex-team.com> | 2024-08-17 21:51:59 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.com> | 2024-08-17 22:04:51 +0300 |
commit | ee9edbd8878888bafcd0eeb3b528f3ec4311560b (patch) | |
tree | d54d8138e50a446904f10a2092719be86af011b7 /contrib/tools/python3/Lib/linecache.py | |
parent | 72cbe4bad58add0912623ba51351ff1db8587249 (diff) | |
download | ydb-ee9edbd8878888bafcd0eeb3b528f3ec4311560b.tar.gz |
Update Python 3 to 3.12.5
https://docs.python.org/release/3.12.5/whatsnew/changelog.html#python-3-12-5-final
de86cdeacd3a8653b9ec36e87975886fafcf6dc2
Diffstat (limited to 'contrib/tools/python3/Lib/linecache.py')
-rw-r--r-- | contrib/tools/python3/Lib/linecache.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/tools/python3/Lib/linecache.py b/contrib/tools/python3/Lib/linecache.py index 5585216d2b5..05eb49d3b05 100644 --- a/contrib/tools/python3/Lib/linecache.py +++ b/contrib/tools/python3/Lib/linecache.py @@ -70,7 +70,7 @@ def checkcache(filename=None): continue # no-op for files loaded via a __loader__ try: stat = os.stat(fullname) - except OSError: + except (OSError, ValueError): cache.pop(filename, None) continue if size != stat.st_size or mtime != stat.st_mtime: @@ -140,10 +140,12 @@ def updatecache(filename, module_globals=None): try: stat = os.stat(fullname) break - except OSError: + except (OSError, ValueError): pass else: return [] + except ValueError: # may be raised by os.stat() + return [] try: with tokenize.open(fullname) as fp: lines = fp.readlines() |