Skip to content

Commit

Permalink
pythongh-121735: Allow all modules to be processed by the ZipReader.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 15, 2024
1 parent 5114623 commit 0e62d51
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions Lib/zipimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,9 @@ def load_module(self, fullname):


def get_resource_reader(self, fullname):
"""Return the ResourceReader for a package in a zip file.
If 'fullname' is a package within the zip file, return the
'ResourceReader' object for the package. Otherwise return None.
"""
try:
if not self.is_package(fullname):
return None
except ZipImportError:
return None
"""Return the ResourceReader for a module in a zip file."""
from importlib.readers import ZipReader

return ZipReader(self, fullname)


Expand Down

0 comments on commit 0e62d51

Please sign in to comment.