Gabriel Becedillas wrote: > Does anybody see any problem with this approach ?, Does anybody have a > cleaner/better solution ? I don't think there *is* a solution: asynchronous exceptions and thread cancellation just cannot work. In the specific case, the caller of PyErr_Clear will continue its computation, instead of immediately leaving the function. To solve this specific problem, you would also have to give PyErr_Clear an int return code (whether or not the exception was cleared), and then you need to change all uses of PyErr_Clear to check for failure, and return immediately (after performing local cleanup, of course). You then need to come up with a protocol to determine whether an exception is "clearable"; the new exception hierarchy suggests that one should "normally" only catch Exception, and let any other BaseException through. So PyErr_Clear should grow a flag indicating whether you want to clear just all Exceptions, or indeed all BaseExceptions. Regards, Martin
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