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

@ -915,7 +915,7 @@ class SourceLoader(_LoaderBasics):
path = self.get_filename(fullname)
try:
source_bytes = self.get_data(path)
except IOError as exc:
except OSError as exc:
raise ImportError("source not available through get_data()",
name=fullname) from exc
readsource = _io.BytesIO(source_bytes).readline
@ -961,7 +961,7 @@ class SourceLoader(_LoaderBasics):
source_mtime = int(st['mtime'])
try:
data = self.get_data(bytecode_path)
except IOError:
except OSError:
pass
else:
try: