[docs] [issue23227] Generator's finally block not run if close() called before first iteration

Antoine Pitrou report at bugs.python.org
Thu Apr 23 01:11:08 CEST 2015


Antoine Pitrou added the comment:

This looks logical to me. The "finally" block is only entered if the "try" block is ever entered, but if you don't consume anything in the generator then the generator's code is never actually executed.

----------
nosy: +pitrou

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


More information about the docs mailing list