From: Philip J. <re...@bu...> - 2009-06-22 06:36:10
|
New submission from Philip Jenvey <pj...@us...>: Jython 2.5.0+ (trunk:6489M, Jun 21 2009, 16:33:51) [Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_07 Type "help", "copyright", "credits" or "license" for more information. >>> genexp = (i for i in range(2)) >>> genexp.throw(Exception) Traceback (most recent call last): File "<stdin>", line 1, in <module> Exception >>> genexp.gi_frame <frame object at 0x1> >>> genexp.next() 0 Python 2.5.4 (r254:67916, Apr 15 2009, 13:13:35) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> genexp = (i for i in range(2)) >>> genexp.throw(Exception) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 1, in <genexpr> Exception >>> genexp.gi_frame >>> genexp.next() Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration Works as expected if the generator was already started (the stack trace is also improved) Jython 2.5.0+ (trunk:6489M, Jun 21 2009, 16:33:51) [Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_07 Type "help", "copyright", "credits" or "license" for more information. >>> genexp = (i for i in range(5)) >>> genexp.next() 0 >>> genexp.throw(Exception) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 1, in <genexpr> Exception >>> genexp.gi_frame >>> genexp.next() Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration ---------- components: Core messages: 4851 nosy: pjenvey priority: normal severity: normal status: open title: generator.throw uncaught on new generator doesn't stop the generator _______________________________________ Jython tracker <re...@bu...> <http://bugs.jython.org/issue1385> _______________________________________ |