]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35259: Limit `Py_FinalizeEx()` to `Py_LIMITED_API >= 0x03060000`. (GH-10620)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 20 Dec 2018 21:39:35 +0000 (13:39 -0800)
committerGitHub <noreply@github.com>
Thu, 20 Dec 2018 21:39:35 +0000 (13:39 -0800)
(cherry picked from commit 3e8f962e63c2f929604443531a9a3aced242f3e8)

Co-authored-by: Arthur Neufeld <aneufeld@seinesoftware.ca>
Include/pylifecycle.h
Misc/NEWS.d/next/C API/2018-11-22-13-52-36.bpo-35259.p07c61.rst [new file with mode: 0644]

index 8e531cf68baf07a5fb07f2d74a52a4a8b6299ac5..05f17dc73f08ce0df36fc9978d4b4009bb38de8b 100644 (file)
@@ -99,7 +99,9 @@ PyAPI_FUNC(void) Py_InitializeEx(int);
 PyAPI_FUNC(void) _Py_FatalInitError(_PyInitError err) _Py_NO_RETURN;
 #endif
 PyAPI_FUNC(void) Py_Finalize(void);
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
 PyAPI_FUNC(int) Py_FinalizeEx(void);
+#endif
 PyAPI_FUNC(int) Py_IsInitialized(void);
 
 /* Subinterpreter support */
diff --git a/Misc/NEWS.d/next/C API/2018-11-22-13-52-36.bpo-35259.p07c61.rst b/Misc/NEWS.d/next/C API/2018-11-22-13-52-36.bpo-35259.p07c61.rst
new file mode 100644 (file)
index 0000000..1f4801c
--- /dev/null
@@ -0,0 +1,2 @@
+Conditionally declare :c:func:`Py_FinalizeEx()` (new in 3.6) based on
+Py_LIMITED_API. Patch by Arthur Neufeld.