[Python-checkins] bpo-38835: Exclude PyFPE macros from the stable API (GH-17228)

Victor Stinner webhook-mailer at python.org
Wed Nov 20 06:17:14 EST 2019


https://github.com/python/cpython/commit/488d02a24142948bfb1fafd19fa48e61fcbbabc5
commit: 488d02a24142948bfb1fafd19fa48e61fcbbabc5
branch: master
author: Victor Stinner <vstinner at python.org>
committer: GitHub <noreply at github.com>
date: 2019-11-20T12:17:09+01:00
summary:

bpo-38835: Exclude PyFPE macros from the stable API (GH-17228)

Exclude PyFPE_START_PROTECT() and PyFPE_END_PROTECT() macros of
pyfpe.h from Py_LIMITED_API (stable API).

files:
A Misc/NEWS.d/next/C API/2019-11-18-15-38-23.bpo-38835.II8Szd.rst
M Doc/whatsnew/3.9.rst
M Include/pyfpe.h

diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index ce1d3e0e96a58..542a031960013 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -226,6 +226,10 @@ Build and C API Changes
   and refers to a constant string.
   (Contributed by Serhiy Storchaka in :issue:`38650`.)
 
+* Exclude ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` macros of
+  ``pyfpe.h`` from ``Py_LIMITED_API`` (stable API).
+  (Contributed by Victor Stinner in :issue:`38835`.)
+
 
 Deprecated
 ==========
diff --git a/Include/pyfpe.h b/Include/pyfpe.h
index 5a99e3979311f..cc2def63aa552 100644
--- a/Include/pyfpe.h
+++ b/Include/pyfpe.h
@@ -1,5 +1,7 @@
 #ifndef Py_PYFPE_H
 #define Py_PYFPE_H
+/* Header excluded from the stable API */
+#ifndef Py_LIMITED_API
 
 /* These macros used to do something when Python was built with --with-fpectl,
  * but support for that was dropped in 3.7. We continue to define them though,
@@ -9,4 +11,5 @@
 #define PyFPE_START_PROTECT(err_string, leave_stmt)
 #define PyFPE_END_PROTECT(v)
 
+#endif /* !defined(Py_LIMITED_API) */
 #endif /* !Py_PYFPE_H */
diff --git a/Misc/NEWS.d/next/C API/2019-11-18-15-38-23.bpo-38835.II8Szd.rst b/Misc/NEWS.d/next/C API/2019-11-18-15-38-23.bpo-38835.II8Szd.rst
new file mode 100644
index 0000000000000..2bb84dc19b6ff
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2019-11-18-15-38-23.bpo-38835.II8Szd.rst	
@@ -0,0 +1,2 @@
+Exclude ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` macros of
+``pyfpe.h`` from ``Py_LIMITED_API`` (stable API).



More information about the Python-checkins mailing list