8000 gh-121735: Fix module-adjacent references in zip files by jaraco · Pull Request #123037 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-121735: Fix module-adjacent references in zip files #123037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 12, 2024
Prev Previous commit
Next Next commit
gh-121735: Allow all modules to be processed by the ZipReader.
  • Loading branch information
jaraco committed Aug 15, 2024
commit 0e62d515258d29d5df2e4dd159f5aca0492cb2d1
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