Vitja Makarov
2011-04-17 15:57:28 UTC
Hi!
2. GeneratorExit is initialized to StopIteration when running
generators_py doctests
This is strange behaviour of doctest module, try this:
x = __builtins__
def foo():
"""
"""
3. check_yield_in_exception()
Cython calls __Pyx_ExceptionReset when except block is done, so when
yield is there no exception reset is called.
I'm not sure how to fix this.
import sys
def foo():
"""
"""
try:
raise ValueError
except ValueError:
yield sys.exc_info()[0]
yield sys.exc_info()[0] # exc_info is lost here
Here is quick fix for 1 and 2 https://github.com/cython/cython/pull/25
list((lambda:((yield 1), (yield 2)))())
[1, 2, (None, None)]list((lambda:((yield 1), (yield 2)))())
[1, 2]2. GeneratorExit is initialized to StopIteration when running
generators_py doctests
This is strange behaviour of doctest module, try this:
x = __builtins__
def foo():
"""
type(x)
<type 'module'>"""
3. check_yield_in_exception()
Cython calls __Pyx_ExceptionReset when except block is done, so when
yield is there no exception reset is called.
I'm not sure how to fix this.
import sys
def foo():
"""
list(foo())
[<type 'exceptions.ValueError'>, None]"""
try:
raise ValueError
except ValueError:
yield sys.exc_info()[0]
yield sys.exc_info()[0] # exc_info is lost here
Here is quick fix for 1 and 2 https://github.com/cython/cython/pull/25
--
vitja.
vitja.