[issue5218] Check for tp_iter in ceval:ext_do_call before overriding exception message

Antoine Pitrou report at bugs.python.org
Wed Feb 11 20:41:45 CET 2009


Antoine Pitrou <pitrou at free.fr> added the comment:

You must check tp_iter as well, not only Py_TPFLAGS_HAVE_ITER.
Py_TPFLAGS_HAVE_ITER only tells you that the tp_iter field exists, not
that it's non-NULL.
(see the code for PyObject_GetIter() in Objects/abstract.c for an example)

----------
nosy: +pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5218>
_______________________________________


More information about the Python-bugs-list mailing list