On 03/29/2014 01:47 PM, Nick Coghlan wrote: > On 30 March 2014 03:05, Ethan Furman <ethan at stoneleaf.us> wrote: >> >> This bit of code won't even finish compiling. I am not sure if my >> understanding of references (and how these functions create/consume them) or >> my understanding of when and where to call PyErr_Fetch|Restore or >> PyException_SetContext is at fault, but I would greatly appreciate somebody >> correcting my understanding. :) > > I had to figure this out for the codec exception chaining in Python > 3.4, and the main piece that appears to be missing from your code is > an appropriate call to PyErr_NormalizeException(). (The interpreter > tries to avoid actually instantiating exceptions if it can, with the > consequence that explicit normalisation is often needed before > non-trivial operations on the current exception)h One of the many gyrations I tried before asking for help involved calling PyErr_NormalizeException, but it didn't seem to solve the problem so I removed it before posting the minimum that I thought should work. > This is the code that does the heavy lifting for the codec exception > chaining in Python 3.4: > > http://hg.python.org/cpython/file/36492f927a40/Objects/exceptions.c#l2644 > http://hg.python.org/cpython/file/36492f927a40/Objects/exceptions.c#l2764 Thanks, I'll check those out. -- ~Ethan~
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4