Message266361
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. |
|
Date |
User |
Action |
Args |
2016-05-25 14:30:40 | ncoghlan | set | recipients:
+ ncoghlan, vstinner, gps, yselivanov, Valentin David |
2016-05-25 14:30:40 | ncoghlan | set | messageid: <1464186640.63.0.295256446094.issue27122@psf.upfronthosting.co.za> |
2016-05-25 14:30:40 | ncoghlan | link | issue27122 messages |
2016-05-25 14:30:40 | ncoghlan | create | |
|