Skip to content

Commit e839848

Browse files
authored
Merge branch 'main' into issue-133403
2 parents b7c013a + 421ba58 commit e839848

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+519
-109
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/c-api/intro.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -826,14 +826,17 @@ frequently used builds will be described in the remainder of this section.
826826
827827
Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined produces
828828
what is generally meant by :ref:`a debug build of Python <debug-build>`.
829-
:c:macro:`!Py_DEBUG` is enabled in the Unix build by adding
830-
:option:`--with-pydebug` to the :file:`./configure` command.
831-
It is also implied by the presence of the
832-
not-Python-specific :c:macro:`!_DEBUG` macro. When :c:macro:`!Py_DEBUG` is enabled
833-
in the Unix build, compiler optimization is disabled.
829+
830+
On Unix, :c:macro:`!Py_DEBUG` can be enabled by adding :option:`--with-pydebug`
831+
to the :file:`./configure` command. This will also disable compiler optimization.
832+
833+
On Windows, selecting a debug build (e.g., by passing the :option:`-d` option to
834+
:file:`PCbuild/build.bat`) automatically enables :c:macro:`!Py_DEBUG`.
835+
Additionally, the presence of the not-Python-specific :c:macro:`!_DEBUG` macro,
836+
when defined by the compiler, will also implicitly enable :c:macro:`!Py_DEBUG`.
834837

835838
In addition to the reference count debugging described below, extra checks are
836-
performed, see :ref:`Python Debug Build <debug-build>`.
839+
performed. See :ref:`Python Debug Build <debug-build>` for more details.
837840

838841
Defining :c:macro:`Py_TRACE_REFS` enables reference tracing
839842
(see the :option:`configure --with-trace-refs option <--with-trace-refs>`).

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Pending removal in Python 3.15
22
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33

44
* The bundled copy of ``libmpdecimal``.
5-
* The :c:func:`PyImport_ImportModuleNoBlock`:
5+
* The :c:func:`!PyImport_ImportModuleNoBlock`:
66
Use :c:func:`PyImport_ImportModule` instead.
77
* :c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`:
88
Use :c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project

Doc/whatsnew/2.6.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3043,7 +3043,7 @@ Changes to Python's build process and to the C API include:
30433043

30443044
* Importing modules simultaneously in two different threads no longer
30453045
deadlocks; it will now raise an :exc:`ImportError`. A new API
3046-
function, :c:func:`PyImport_ImportModuleNoBlock`, will look for a
3046+
function, :c:func:`!PyImport_ImportModuleNoBlock`, will look for a
30473047
module in ``sys.modules`` first, then try to import it after
30483048
acquiring an import lock. If the import lock is held by another
30493049
thread, an :exc:`ImportError` is raised.

Doc/whatsnew/3.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ to the C API.
870870
* :c:func:`!PyNumber_Coerce`, :c:func:`!PyNumber_CoerceEx`,
871871
:c:func:`!PyMember_Get`, and :c:func:`!PyMember_Set` C APIs are removed.
872872

873-
* New C API :c:func:`PyImport_ImportModuleNoBlock`, works like
873+
* New C API :c:func:`!PyImport_ImportModuleNoBlock`, works like
874874
:c:func:`PyImport_ImportModule` but won't block on the import lock
875875
(returning an error instead).
876876

Doc/whatsnew/3.13.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2499,7 +2499,7 @@ Deprecated C APIs
24992499
which return a :term:`borrowed reference`.
25002500
(Soft deprecated as part of :pep:`667`.)
25012501

2502-
* Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function,
2502+
* Deprecate the :c:func:`!PyImport_ImportModuleNoBlock` function,
25032503
which is just an alias to :c:func:`PyImport_ImportModule` since Python 3.3.
25042504
(Contributed by Victor Stinner in :gh:`105396`.)
25052505

Doc/whatsnew/3.15.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,5 @@ Deprecated C APIs
164164
Removed C APIs
165165
--------------
166166

167+
* :c:func:`!PyImport_ImportModuleNoBlock`: deprecated alias
168+
of :c:func:`PyImport_ImportModule`.

Doc/whatsnew/3.3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ Previous versions of CPython have always relied on a global import lock.
829829
This led to unexpected annoyances, such as deadlocks when importing a module
830830
would trigger code execution in a different thread as a side-effect.
831831
Clumsy workarounds were sometimes employed, such as the
832-
:c:func:`PyImport_ImportModuleNoBlock` C API function.
832+
:c:func:`!PyImport_ImportModuleNoBlock` C API function.
833833

834834
In Python 3.3, importing a module takes a per-module lock. This correctly
835835
serializes importation of a given module from multiple threads (preventing

0 commit comments

Comments
 (0)