Skip to content

Commit 1a68caa

Browse files
committed
remove PyImport_ImportModuleNoBlock
1 parent 4fcd377 commit 1a68caa

File tree

13 files changed

+4
-75
lines changed

13 files changed

+4
-75
lines changed

Doc/c-api/import.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@ Importing Modules
1616
This is a wrapper around :c:func:`PyImport_Import()` which takes a
1717
:c:expr:`const char *` as an argument instead of a :c:expr:`PyObject *`.
1818
19-
.. c:function:: PyObject* PyImport_ImportModuleNoBlock(const char *name)
20-
21-
This function is a deprecated alias of :c:func:`PyImport_ImportModule`.
22-
23-
.. versionchanged:: 3.3
24-
This function used to fail immediately when the import lock was held
25-
by another thread. In Python 3.3 though, the locking scheme switched
26-
to per-module locks for most purposes, so this function's special
27-
behaviour isn't needed anymore.
28-
29-
.. deprecated-removed:: 3.13 3.15
30-
Use :c:func:`PyImport_ImportModule` instead.
31-
3219
3320
.. c:function:: PyObject* PyImport_ImportModuleEx(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist)
3421

Doc/data/refcounts.dat

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,9 +1093,6 @@ PyImport_ImportModuleLevelObject:PyObject*:locals:0:???
10931093
PyImport_ImportModuleLevelObject:PyObject*:fromlist:0:???
10941094
PyImport_ImportModuleLevelObject:int:level::
10951095

1096-
PyImport_ImportModuleNoBlock:PyObject*::+1:
1097-
PyImport_ImportModuleNoBlock:const char*:name::
1098-
10991096
PyImport_ReloadModule:PyObject*::+1:
11001097
PyImport_ReloadModule:PyObject*:m:0:
11011098

Doc/data/stable_abi.dat

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ Pending removal in Python 3.15
22
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33

44
* The bundled copy of ``libmpdecimal``.
5-
* The :c:func:`PyImport_ImportModuleNoBlock`:
6-
Use :c:func:`PyImport_ImportModule` instead.
75
* :c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`:
86
Use :c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project
97
<https://github.com/python/pythoncapi-compat/>`__ can be used to get

Doc/whatsnew/3.15.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,5 @@ Deprecated C APIs
155155
Removed C APIs
156156
--------------
157157

158+
* :c:func:`!PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`
159+
instead.

Include/import.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ PyAPI_FUNC(PyObject *) PyImport_AddModuleRef(
5151
PyAPI_FUNC(PyObject *) PyImport_ImportModule(
5252
const char *name /* UTF-8 encoded string */
5353
);
54-
Py_DEPRECATED(3.13) PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(
55-
const char *name /* UTF-8 encoded string */
56-
);
5754
PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(
5855
const char *name, /* UTF-8 encoded string */
5956
PyObject *globals,

Lib/test/test_capi/test_import.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,6 @@ def test_importmodule(self):
133133
self.assertRaises(UnicodeDecodeError, importmodule, b'\xff')
134134
# CRASHES importmodule(NULL)
135135

136-
def test_importmodulenoblock(self):
137-
# Test deprecated PyImport_ImportModuleNoBlock()
138-
importmodulenoblock = _testlimitedcapi.PyImport_ImportModuleNoBlock
139-
with check_warnings(('', DeprecationWarning)):
140-
self.check_import_func(importmodulenoblock)
141-
self.assertRaises(UnicodeDecodeError, importmodulenoblock, b'\xff')
142-
143-
# CRASHES importmodulenoblock(NULL)
144-
145136
def check_frozen_import(self, import_frozen_module):
146137
# Importing a frozen module executes its code, so start by unloading
147138
# the module to execute the code in a new (temporary) module.

Lib/test/test_stable_abi_ctypes.py

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Remove deprecated :c:func:`!PyImport_ImportModuleNoBlock`. Use
2+
:c:func:`PyImport_ImportModule` instead. Patch by Bénédikt Tran.

Misc/stable_abi.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,8 +886,6 @@
886886
added = '3.2'
887887
[function.PyImport_ImportModuleLevel]
888888
added = '3.2'
889-
[function.PyImport_ImportModuleNoBlock]
890-
added = '3.2'
891889
[function.PyImport_ReloadModule]
892890
added = '3.2'
893891
[function.PyInterpreterState_Clear]

0 commit comments

Comments
 (0)