[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

Daniel Urban report at bugs.python.org
Mon Mar 7 08:21:25 CET 2011


Daniel Urban <urban.dani+py at gmail.com> added the comment:

I'm attaching an updated patch. Instead !PyIter_Check() this patch checks for tp_iter == NULL && !PySequence_Check.  If this condition is false, PyObject_GetIter has a chance to succeed (and if it fails, we shouldn't mask the exception).  I also added more tests which show why the previous patch was incorrect.

----------
Added file: http://bugs.python.org/file21028/issue4806.patch

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


More information about the Python-bugs-list mailing list