Skip to content

Commit 7c36afa

Browse files
committed
Apply picnixz suggesions
1 parent cfd1976 commit 7c36afa

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

Doc/deprecations/pending-removal-in-3.15.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,6 @@ Pending removal in Python 3.15
8181

8282
* :mod:`zipimport`:
8383

84-
* :meth:`~zipimport.zipimporter.load_module` has been deprecated since
85-
Python 3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead.
84+
* :meth:`~zipimport.zipimporter.load_module` has been deprecated since
85+
Python 3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead.
86+
(Contributed by Jiahao Li in :gh:`125746`.)

Doc/library/zipimport.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ zipimporter Objects
148148
qualified (dotted) module name. Returns the imported module on success,
149149
raises :exc:`ZipImportError` on failure.
150150

151-
.. deprecated:: 3.10
151+
.. deprecated-removed:: 3.10 3.15
152152

153153
Use :meth:`exec_module` instead.
154154

Lib/zipimport.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import marshal # for loads
2121
import sys # for modules
2222
import time # for mktime
23-
import warnings # For warnings
2423

2524
__all__ = ['ZipImportError', 'zipimporter']
2625

@@ -221,10 +220,11 @@ def load_module(self, fullname):
221220
222221
Deprecated since Python 3.10. Use exec_module() instead.
223222
"""
223+
import warnings
224224
warnings._deprecated("zipimport.zipimporter.load_module",
225-
f"{warnings._DEPRECATED_MSG}; "
226-
"use zipimport.zipimporter.exec_module() instead",
227-
remove=(3, 15))
225+
f"{warnings._DEPRECATED_MSG}; "
226+
"use zipimport.zipimporter.exec_module() instead",
227+
remove=(3, 15))
228228
code, ispackage, modpath = _get_module_code(self, fullname)
229229
mod = sys.modules.get(fullname)
230230
if mod is None or not isinstance(mod, _module_type):
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Delay deprecated :meth:`~zipimport.zipimporter.load_module` removal
2-
time to 3.15. Use :meth:`~zipimport.zipimporter.exec_module` instead.
1+
Delay deprecated :meth:`zipimport.zipimporter.load_module` removal
2+
time to 3.15. Use :meth:`zipimport.zipimporter.exec_module` instead.

0 commit comments

Comments
 (0)