mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
[3.12] gh-121735: Fix module-adjacent references in zip files (gh-123037) (#124011)
This commit is contained in:
parent
10cf0b8caf
commit
c60d97805f
4 changed files with 45 additions and 12 deletions
|
@ -254,17 +254,9 @@ class zipimporter(_bootstrap_external._LoaderBasics):
|
|||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue