Mercurial > cpython-lru_cache-weakref
changeset 77658:515747aa191f
Replace assert() with a more informative fatal error.
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Sun, 24 Jun 2012 00:30:12 +0200 |
| parents | 192e97dd5acf |
| children | 33737210c906 |
| files | Objects/typeobject.c |
| diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/Objects/typeobject.c Sun Jun 24 00:20:26 2012 +0200 +++ b/Objects/typeobject.c Sun Jun 24 00:30:12 2012 +0200 @@ -2858,7 +2858,12 @@ { /* 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);
