gh-105396: Deprecate PyImport_ImportModuleNoBlock() function (#105397)

Deprecate the PyImport_ImportModuleNoBlock() function which is just
an alias to PyImport_ImportModule() since Python 3.3.
This commit is contained in:
Victor Stinner 2023-06-09 10:30:57 +02:00 committed by GitHub
parent a5f23d4110
commit 3e525d2212
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 1 deletions

View file

@ -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);
}