Message228195
I'm attaching a patch that works without changing the recursion limit, and adds some tests for pathological cases.
Instead, PyErr_GivenExceptionMatches is changed so that if an exception was previously set, it is replaced by an exception that PyObject_IsSubclass raises. In that way recursion errors should be propagated properly.
In exception matching, this means that exceptions (including recursion errors) from PyObject_IsSubclass are ignored. There is already an explicit test for this behavior in test_exceptions.
This behavior *could* be changed if intended by introducing a variant of PyErr_GivenExceptionMatches that can set an exception even if none was set before, and calling that in cmp_outcome in ceval. |
|
Date |
User |
Action |
Args |
2014-10-02 10:01:50 | georg.brandl | set | recipients:
+ georg.brandl, gvanrossum, barry, jamesh, ncoghlan, pitrou, benjamin.peterson, jwilk, eric.araujo, Trundle, cvrebert, daniel.urban, yorik.sar, ethan.furman, Yury.Selivanov, Jim.Jewett, gcbirzan, Antony.Lee |
2014-10-02 10:01:50 | georg.brandl | set | messageid: <1412244110.12.0.400891916806.issue12029@psf.upfronthosting.co.za> |
2014-10-02 10:01:50 | georg.brandl | link | issue12029 messages |
2014-10-02 10:01:49 | georg.brandl | create | |
|