Skip to content

Commit

Permalink
Give the native reader precedence when available.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 25, 2024
1 parent 56915b8 commit 3e24498
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions importlib_resources/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ def _file_reader(spec):
return readers.FileReader(self)

return (
# native reader if it supplies 'files'
_native_reader(self.spec)
or
# local ZipReader if a zip module
_zip_reader(self.spec)
or
Expand All @@ -82,9 +85,6 @@ def _file_reader(spec):
# local FileReader
_file_reader(self.spec)
or
# native reader if it supplies 'files'
_native_reader(self.spec)
or
# fallback - adapt the spec ResourceReader to TraversableReader
_adapters.CompatibilityFiles(self.spec)
)
Expand Down

0 comments on commit 3e24498

Please sign in to comment.