-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-133656: Remove deprecated zipimport.zipimporter.load_module
#133662
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
base: main
Are you sure you want to change the base?
Conversation
considering how pyhton imports work, You might have to modify the files that run on import or any references to load_module. This will be a really daunting task for you :( sorry! |
@Wulian233 Will review tmrw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR seems sound, however I'll approve it after stanfromireland
and hugovk
resolve their conversation, because I am not sure either if it should or shouldn't be in the devguide either :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some additional sys.path
manipulation added to the test case that doesn't look like it should be necessary.
Otherwise this looks good to me.
@@ -552,17 +551,12 @@ def testZipImporterMethods(self): | |||
"spam" + pyc_ext: test_pyc} | |||
self.makeZip(files, file_comment=b"spam") | |||
|
|||
sys.path.insert(0, TEMP_ZIP) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addition to the test case doesn't seem like it should be necessary.
@@ -671,15 +665,12 @@ def testZipImporterMethodsInSubDirectory(self): | |||
packdir2 + TESTMOD + pyc_ext: test_pyc} | |||
self.makeZip(files, file_comment=b"eggs") | |||
|
|||
sys.path.insert(0, TEMP_ZIP + os.sep + TESTPACK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above (this addition doesn't look correct)
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
That's necessary. If these two lines are removed, the test will fail (p1) with a And https://github.com/Wulian233/cpython/blob/5616e27403799b481f44f96c3a21336fd03941c9/Lib/test/test_zipimport.py#L165 https://github.com/Wulian233/cpython/blob/5616e27403799b481f44f96c3a21336fd03941c9/Lib/test/test_zipimport.py#L420-L422 |
Ready review!
zipimport.zipimporter.load_module
#133656📚 Documentation preview 📚: https://cpython-previews--133662.org.readthedocs.build/