mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Replace IOError with OSError (#16715)
This commit is contained in:
parent
16bdd4120d
commit
f7a17b48d7
121 changed files with 381 additions and 386 deletions
|
|
@ -91,7 +91,7 @@ def updatecache(filename, module_globals=None):
|
|||
if name and get_source:
|
||||
try:
|
||||
data = get_source(name)
|
||||
except (ImportError, IOError):
|
||||
except (ImportError, OSError):
|
||||
pass
|
||||
else:
|
||||
if data is None:
|
||||
|
|
@ -125,7 +125,7 @@ def updatecache(filename, module_globals=None):
|
|||
try:
|
||||
with tokenize.open(fullname) as fp:
|
||||
lines = fp.readlines()
|
||||
except IOError:
|
||||
except OSError:
|
||||
return []
|
||||
if lines and not lines[-1].endswith('\n'):
|
||||
lines[-1] += '\n'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue