diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-02-17 23:23:48 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-02-17 23:51:41 +0100 |
commit | 0b17c79b15c5598a0795baea576656d92dedbcd3 (patch) | |
tree | bc6b841c855acd3cff52151049b1f2e8cd61a8fa | |
parent | 688876e2312ac5b43aca8e6369591897939577a9 (diff) | |
download | astroid-git-0b17c79b15c5598a0795baea576656d92dedbcd3.tar.gz |
Remove IOError that are an alias to OSError see PEP3151
-rw-r--r-- | astroid/builder.py | 2 | ||||
-rw-r--r-- | astroid/interpreter/_import/spec.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/astroid/builder.py b/astroid/builder.py index 86cba8b1..61e5e7f9 100644 --- a/astroid/builder.py +++ b/astroid/builder.py @@ -106,7 +106,7 @@ class AstroidBuilder(raw_building.InspectBuilder): """ try: stream, encoding, data = open_source_file(path) - except IOError as exc: + except OSError as exc: raise exceptions.AstroidBuildingError( "Unable to load file {path}:\n{error}", modname=modname, diff --git a/astroid/interpreter/_import/spec.py b/astroid/interpreter/_import/spec.py index 52cfdc08..8dd2a922 100644 --- a/astroid/interpreter/_import/spec.py +++ b/astroid/interpreter/_import/spec.py @@ -255,7 +255,7 @@ def _is_setuptools_namespace(location): try: with open(os.path.join(location, "__init__.py"), "rb") as stream: data = stream.read(4096) - except IOError: + except OSError: return None else: extend_path = b"pkgutil" in data and b"extend_path" in data |