@@ -380,55 +380,6 @@ PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
380380#endif
381381
382382
383- /* Define a pair of assertion macros:
384- _PyObject_ASSERT_FROM(), _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT().
385-
386- These work like the regular C assert(), in that they will abort the
387- process with a message on stderr if the given condition fails to hold,
388- but compile away to nothing if NDEBUG is defined.
389-
390- However, before aborting, Python will also try to call _PyObject_Dump() on
391- the given object. This may be of use when investigating bugs in which a
392- particular object is corrupt (e.g. buggy a tp_visit method in an extension
393- module breaking the garbage collector), to help locate the broken objects.
394-
395- The WITH_MSG variant allows you to supply an additional message that Python
396- will attempt to print to stderr, after the object dump. */
397- #ifdef NDEBUG
398- /* No debugging: compile away the assertions: */
399- # define _PyObject_ASSERT_FROM (obj , expr , msg , filename , lineno , func ) \
400- ((void)0)
401- #else
402- /* With debugging: generate checks: */
403- # define _PyObject_ASSERT_FROM (obj , expr , msg , filename , lineno , func ) \
404- ((expr) \
405- ? (void)(0) \
406- : _PyObject_AssertFailed((obj), Py_STRINGIFY(expr), \
407- (msg), (filename), (lineno), (func)))
408- #endif
409-
410- #define _PyObject_ASSERT_WITH_MSG (obj , expr , msg ) \
411- _PyObject_ASSERT_FROM((obj), expr, (msg), __FILE__, __LINE__, __func__)
412- #define _PyObject_ASSERT (obj , expr ) \
413- _PyObject_ASSERT_WITH_MSG((obj), expr, NULL)
414-
415- #define _PyObject_ASSERT_FAILED_MSG (obj , msg ) \
416- _PyObject_AssertFailed((obj), NULL, (msg), __FILE__, __LINE__, __func__)
417-
418- /* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined,
419- to avoid causing compiler/linker errors when building extensions without
420- NDEBUG against a Python built with NDEBUG defined.
421-
422- msg, expr and function can be NULL. */
423- PyAPI_FUNC (void ) _Py_NO_RETURN _PyObject_AssertFailed (
424- PyObject * obj ,
425- const char * expr ,
426- const char * msg ,
427- const char * file ,
428- int line ,
429- const char * function );
430-
431-
432383PyAPI_FUNC (void ) _PyTrash_thread_deposit_object (PyThreadState * tstate , PyObject * op );
433384PyAPI_FUNC (void ) _PyTrash_thread_destroy_chain (PyThreadState * tstate );
434385
0 commit comments