Nick Coghlan added the comment:

The suggested fix looks basically correct to me - the problem is that the new 
except clause added by that patch is currently missing the "don't re-raise the 
passed in exception" logic needed to fully abide by the context management 
protocol, but we missed that on the patch review.

The only tweak I would recommend is putting that check before the check for 
StopIteration being converted to RuntimeError so it's immediately obvious to 
the reader that it takes priority over the exc.__cause__ check.

The comment on that clause should also be adjusted to reflect the fixed 
behaviour.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27122>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to