[pypy-issue] [issue736] 'finally' suite not invoked in generator function

Jonas H. tracker at bugs.pypy.org
Fri Jun 3 15:07:37 CEST 2011

New submission from Jonas H. <jonas at lophus.org>:

Consider this code sample:

def g():
        yield 1
        print 'finally'


CPython behaves differently from PyPy:

$ python2.7 asd.py 
$ pypy asd.py

The finally suite is executed only if the generator is exhausted in such way 
that StopIteration is raised.

messages: 2591
nosy: jonash, pypy-issue
priority: bug
status: unread
title: 'finally' suite not invoked in generator function

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list