summaryrefslogtreecommitdiff
path: root/Include/object.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-21 23:53:44 +0100
committerGitHub <noreply@github.com>2018-11-21 23:53:44 +0100
commitf1d002c1e094922b0f17a820f90ff102d68ab253 (patch)
tree4f9b4d17b8465d0b9b2fbd1f8da4491011a8e00d /Include/object.h
parentbcda8f1d42a98d9022736dd52d855be8e220fe15 (diff)
downloadcpython-git-f1d002c1e094922b0f17a820f90ff102d68ab253.tar.gz
bpo-35059: Enhance _PyObject_AssertFailed() (GH-10642)
Enhance _PyObject_AssertFailed() * Exchange 'expr' and 'msg' parameters * 'expr' and 'func' arguments can now be NULL
Diffstat (limited to 'Include/object.h')
-rw-r--r--Include/object.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/Include/object.h b/Include/object.h
index 48ce9d2b97..0d84d3604f 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -1158,8 +1158,8 @@ _PyObject_DebugTypeStats(FILE *out);
((expr) \
? (void)(0) \
: _PyObject_AssertFailed((obj), \
- (msg), \
Py_STRINGIFY(expr), \
+ (msg), \
__FILE__, \
__LINE__, \
__func__))
@@ -1169,11 +1169,13 @@ _PyObject_DebugTypeStats(FILE *out);
/* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined,
to avoid causing compiler/linker errors when building extensions without
- NDEBUG against a Python built with NDEBUG defined. */
+ NDEBUG against a Python built with NDEBUG defined.
+
+ msg, expr and function can be NULL. */
PyAPI_FUNC(void) _PyObject_AssertFailed(
PyObject *obj,
- const char *msg,
const char *expr,
+ const char *msg,
const char *file,
int line,
const char *function);