Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-105396: Deprecate PyImport_ImportModuleNoBlock() function#105397

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 2 commits intopython:mainfromvstinner:deprecate_pyimport_noblock
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletionsDoc/c-api/import.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,6 +38,9 @@ Importing Modules
to per-module locks for most purposes, so this function's special
behaviour isn't needed anymore.

.. deprecated-removed:: 3.13 3.15
Use :c:func:`PyImport_ImportModule` instead.


.. c:function:: PyObject* PyImport_ImportModuleEx(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist)

Expand Down
5 changes: 5 additions & 0 deletionsDoc/whatsnew/3.13.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -393,6 +393,11 @@ Deprecated

(Contributed by Victor Stinner in :gh:`105145`.)

* Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function which is just
an alias to :c:func:`PyImport_ImportModule` since Python 3.3.
Scheduled for removal in Python 3.15.
(Contributed by Victor Stinner in :gh:`105396`.)

Removed
-------

Expand Down
2 changes: 1 addition & 1 deletionInclude/import.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,7 @@ PyAPI_FUNC(PyObject *) PyImport_AddModule(
PyAPI_FUNC(PyObject *) PyImport_ImportModule(
const char *name /* UTF-8 encoded string */
);
PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(
Py_DEPRECATED(3.13)PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(
const char *name /* UTF-8 encoded string */
);
PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function which is just
an alias to :c:func:`PyImport_ImportModule` since Python 3.3. Patch by
Victor Stinner.
6 changes: 6 additions & 0 deletionsPython/import.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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);
}

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp