-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
zipimport: Remove deprecated find_loader() and find_module() methods, use find_spec() instead #94379
Comments
…94380) zipimport: Remove find_loader() and find_module() methods, deprecated in Python 3.10: use the find_spec() method instead. See PEP 451 for the rationale.
I'm looking at removing |
@vstinner Shouldn't this ticket be closed given that the PR you referenced was merged? |
First my PR #94380 also tried to remove load_module() but I got issues, so 92bcb26 only removes find_loader() and find_module() methods. This issue title is only "zipimport: Remove deprecated find_loader() and find_module() methods", so yep, I'm fine with closing it. |
Thanks @vstinner. When @brettcannon and I talked about it, we noticed that |
Ah? I only looked at zipimport.py code: # Load and return the module named by 'fullname'.
def load_module(self, fullname):
"""load_module(fullname) -> module.
Load the module specified by 'fullname'. 'fullname' must be the
fully qualified (dotted) module name. It returns the imported
module, or raises ZipImportError if it could not be imported.
Deprecated since Python 3.10. Use exec_module() instead.
"""
msg = ("zipimport.zipimporter.load_module() is deprecated and slated for "
"removal in Python 3.12; use exec_module() instead")
_warnings.warn(msg, DeprecationWarning)
(...) |
In Python 3.10, the find_loader() and find_module() methods of zipimport were deprecated by commit d2e94bb and commit 57c6cb5.
It's now time to remove them. The find_spec() method should be used instead.
See issue #86301 and PEP 451 for the rationale.
I wrote PR #94380 to remove these methods.
The text was updated successfully, but these errors were encountered: