New submission from Erik Allik:
This is either a bug, or a very weird but undocumented feature/caveat.
def fn1():
while True:
try:
raise Exception()
finally:
pass
def fn2():
while True:
try:
raise Exception()
finally:
Mark Dickinson added the comment:
This *was* a documented feature until very recently; it looks as though a
recent doc change inadvertently removed it from the documentation. See
http://hg.python.org/cpython/rev/bef098bd3fa5
and the associated issue, issue 14167.
--
nosy:
Erik Allik added the comment:
It looks to me that it was not removed from the doc but explicitly changed to
say that 'break' does not cause the exception to be discarded, unless I'm
misunderstanding it:
1.20 +:keyword:`finally` clause is executed. If there is a saved exception
1.21
Mark Dickinson added the comment:
Hmm. Yes, true. Either way, it's the docs that need to be fixed rather than
the behaviour.
Thanks for catching this!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16028
Yury Selivanov added the comment:
see the issue 14167
--
nosy: +yselivanov
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16028
___
___
Mark Dickinson added the comment:
That portion of the documentation has been restored. Closing this issue.
--
assignee: - docs@python
components: +Documentation
nosy: +docs@python
resolution: - fixed
status: open - closed
versions: +Python 3.2, Python 3.3