Skip to content

Commit 245d439

Browse files
authored
bpo-38205: Py_UNREACHABLE() calls Py_FatalError() (GH-16290) (GH-16306)
(cherry picked from commit b154258)
1 parent b50edac commit 245d439

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Include/pymacro.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
# define Py_UNUSED(name) _unused_ ## name
101101
#endif
102102

103-
#define Py_UNREACHABLE() abort()
103+
#define Py_UNREACHABLE() \
104+
Py_FatalError("Unreachable C code path reached")
104105

105106
#endif /* Py_PYMACRO_H */
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The :c:func:`Py_UNREACHABLE` macro now calls :c:func:`Py_FatalError`.

0 commit comments

Comments
 (0)