summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-06-24 00:30:12 +0200
committerAntoine Pitrou <solipsis@pitrou.net>2012-06-24 00:30:12 +0200
commit230de62dfd775eeaf2db121b10f9906e43f1156d (patch)
tree8d0bee45181acbca2bc3071d107433ea8ee6bf90 /Objects
parent3941b10daa7579263e01668b5b6f44ddd1a00c0e (diff)
downloadcpython-230de62dfd775eeaf2db121b10f9906e43f1156d.tar.gz
Replace assert() with a more informative fatal error.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 88b23c51e1..dff47f371f 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -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);