From af1b28807d9fec6593230e944658a2d73716f084 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Sun, 4 Oct 2026 17:09:32 -0400 Subject: [PATCH] Docs: Clarify that `ctypes.pythonapi` *may* be `None` under a statically linked interpreter (GH-158624) (cherry picked from commit a7b5fc50e98c1abf38f246b0802f6c9a44779e80) Co-authored-by: Peter Bierma --- Doc/library/ctypes.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 94d33ab9b6a4c34..5b041b87625b87d 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1803,8 +1803,9 @@ object is available: :c:expr:`int`, which is of course not always the truth, so you have to assign the correct :attr:`!restype` attribute to use these functions. - Note that if the Python interpreter is statically linked, this will be - ``None``, as ``dlopen`` is not possible in this case. + .. note:: + + If the Python interpreter is statically linked, this may be ``None``. .. audit-event:: ctypes.dlopen name ctypes.LibraryLoader