Replace IOError with OSError (#16715)

This commit is contained in:
Andrew Svetlov 2012-12-25 16:47:37 +02:00
parent 16bdd4120d
commit f7a17b48d7
121 changed files with 381 additions and 386 deletions

View file

@ -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'