mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Replace assert() with a more informative fatal error.
This commit is contained in:
parent
ad2c43b687
commit
1351ca6e66
1 changed files with 6 additions and 1 deletions
|
@ -2858,7 +2858,12 @@ type_traverse(PyTypeObject *type, visitproc visit, void *arg)
|
|||
{
|
||||
/* Because of type_is_gc(), the collector only calls this
|
||||
for heaptypes. */
|
||||
assert(type->tp_flags & Py_TPFLAGS_HEAPTYPE);
|
||||
if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) {
|
||||
char msg[200];
|
||||
sprintf(msg, "type_traverse() called for non-heap type '%.100s'",
|
||||
type->tp_name);
|
||||
Py_FatalError(msg);
|
||||
}
|
||||
|
||||
Py_VISIT(type->tp_dict);
|
||||
Py_VISIT(type->tp_cache);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue