summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-06-09 08:30:57 (GMT)
committerGitHub <noreply@github.com>2023-06-09 08:30:57 (GMT)
commit3e525d22128cf040b3fd164f52cc6ae20ca58455 (patch)
tree2f13c7b5eaf259a395c3600e2b8a920972c9c2d8 /Python
parenta5f23d411062f9f29f8a7d7ddefe60d5d8e17d2e (diff)
downloadcpython-3e525d22128cf040b3fd164f52cc6ae20ca58455.zip
cpython-3e525d22128cf040b3fd164f52cc6ae20ca58455.tar.gz
cpython-3e525d22128cf040b3fd164f52cc6ae20ca58455.tar.bz2
gh-105396: Deprecate PyImport_ImportModuleNoBlock() function (#105397)
Deprecate the PyImport_ImportModuleNoBlock() function which is just an alias to PyImport_ImportModule() since Python 3.3.
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c
index 7f04b1a..71cce8e 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -2439,6 +2439,12 @@ PyImport_ImportModule(const char *name)
PyObject *
PyImport_ImportModuleNoBlock(const char *name)
{
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "PyImport_ImportModuleNoBlock() is deprecated and scheduled for "
+ "removal in Python 3.15. Use PyImport_ImportModule() instead.", 1))
+ {
+ return NULL;
+ }
return PyImport_ImportModule(name);
}