summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Include/pymacro.h3
-rw-r--r--Misc/NEWS.d/next/C API/2019-09-19-18-26-29.bpo-38205.Db1OJL.rst1
2 files changed, 3 insertions, 1 deletions
diff --git a/Include/pymacro.h b/Include/pymacro.h
index 1890619..495c2c2 100644
--- a/Include/pymacro.h
+++ b/Include/pymacro.h
@@ -100,6 +100,7 @@
# define Py_UNUSED(name) _unused_ ## name
#endif
-#define Py_UNREACHABLE() abort()
+#define Py_UNREACHABLE() \
+ Py_FatalError("Unreachable C code path reached")
#endif /* Py_PYMACRO_H */
diff --git a/Misc/NEWS.d/next/C API/2019-09-19-18-26-29.bpo-38205.Db1OJL.rst b/Misc/NEWS.d/next/C API/2019-09-19-18-26-29.bpo-38205.Db1OJL.rst
new file mode 100644
index 0000000..1818e54
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2019-09-19-18-26-29.bpo-38205.Db1OJL.rst
@@ -0,0 +1 @@
+The :c:func:`Py_UNREACHABLE` macro now calls :c:func:`Py_FatalError`.