[issue11944] Function call with * and generator hide exception raised by generator.

Jeong-Min Lee report at bugs.python.org
Thu Apr 28 11:22:43 CEST 2011


Jeong-Min Lee <falsetru at gmail.com> added the comment:

Some exceptions are reported correctly.


>>> def g():
...     1 / 0
...     yield 1, 2
...     yield 3, 4
... 
>>> zip(*g())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in g
ZeroDivisionError: integer division or modulo by zero



>>> def g():
...     [][0]
...     yield 1, 2
...     yield 3, 4
... 
>>> zip(*g())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in g
IndexError: list index out of range

----------

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


More information about the Python-bugs-list mailing list