Skip to content

Commit

Permalink
EAFP
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcannon committed Oct 27, 2017
1 parent 9ee0528 commit 7af1943
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions importlib_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def open(package: Package, file_name: FileName) -> BinaryIO:
package = _get_package(package)
package_path = pathlib.Path(package.__spec__.origin).resolve().parent
full_path = package_path / file_name
if full_path.exists():
try:
return full_path.open('rb')
else:
except IOError:
# Just assume the loader is a resource loader; all the relevant
# importlib.machinery loaders are and an AttributeError for get_data()
# will make it clear what is needed from the loader.
Expand Down

0 comments on commit 7af1943

Please sign in to comment.