Skip to content

Commit

Permalink
Catch the appropriate exception based on PEP 302
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcannon committed Oct 27, 2017
1 parent 24a57d0 commit 9ee0528
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion importlib_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def open(package: Package, file_name: FileName) -> BinaryIO:
package.__spec__.loader)
try:
data = loader.get_data(str(full_path))
except OSError:
except IOError:
package_name = package.__spec__.name
message = '{!r} resource not found in {!r}'.format(file_name, package_name)
raise FileNotFoundError(message)
Expand Down

0 comments on commit 9ee0528

Please sign in to comment.