Commit 1381447e authored by Antoine Pitrou's avatar Antoine Pitrou

Replace assert() with a more informative fatal error.

parent 1ec26ee0
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment