Issue1331171

classification
Title: generators raising StopIteration are not properly handled
Type: Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, scoder
Priority: high Keywords:

Created on 2005-10-19.09:04:43 by scoder, last changed 2006-08-09.02:43:08 by cgroves.

Messages
msg1050 (view) Author: Stefan Behnel (scoder) Date: 2005-10-19.09:04:43
Test case in Jython:

>>> from __future__ import generators
>>> def gen():
...   yield 1
...   raise StopIteration
...
>>> list(gen())
Traceback (innermost last):
  File "<console>", line 1, in ?
  File "<console>", line 3, in gen
StopIteration:

In CPython:
>>> def gen():
...   yield 1
...   raise StopIteration
...
>>> list(gen())
[1]

Same for tuple(gen()), etc., so the problem seems to
lie in the generator implementation.
msg1051 (view) Author: Charlie Groves (cgroves) Date: 2006-08-09.02:43:08
Logged In: YES 
user_id=1174327

fixed on 2.3 branch in r2875.
History
Date User Action Args
2005-10-19 09:04:43scodercreate