fix exception handling on Python 3.12#3306
Conversation
5dbe51d to
842b35a
Compare
842b35a to
4692ac5
Compare
|
Pushed a more complete implementation which I'm happy with, and updated OP. |
|
I think best if I circle back to this later to split out into multiple PRs for the changes of behaviour / fixes etc. |
d9177ab to
7c65b98
Compare
|
Assuming CI is green, I believe this is now good to review. |
|
On further reflection, I should be able to split this out to first make the |
I am pretty swamped at the moment, so anything that turns this into smaller chunks would be appreciated. |
👍 #3323 |
173dc9d to
291b2e5
Compare
291b2e5 to
b0f07b1
Compare
|
Ok, I think this is as small a diff as it can possibly get. I split off the second commit into #3326. |
b0f07b1 to
0098f1f
Compare
0098f1f to
ab07825
Compare
Reworked exception handling for Python 3.12. Ref #3305
The simplifications to
PyErrStateresult in a ~10-15% perf improvement in thebench_errbenchmarks on all Python versions. On 3.12 the enum size has been reduced from 32 to 24 bytes, which might have small global perf benefits too.While working on this I noticed a bug on <3.12 where the original panic message is not retrieved properly in
PyErr::fetchif thePanicExceptionis normalised. I've added that as a second commit.