7 ms·
Since you mention thinking there must be a better way in hook.c, you can override the traceback printer: https://docs.python.org/3.4/library/sys.html#sys.excep
by maxerickson 12y ago
Since you mention thinking there must be a better way in hook.c, you can override the traceback printer:
https://docs.python.org/3.4/library/sys.html#sys.excepthook https://docs.python.org/3.4/library/sys.html#sys.excepthook
I haven't thought through how to access the state needed to make a suggestion though.
- jamesdutc 12y agoYeah, that was one of the (less-bad) approaches I tried first: https://gist.github.com/dutc/3f2c79048d95287be138 https://gist.github.com/dutc/3f2c79048d95287be138 But you can see it's somewhat limited. And I was curious to actually hook an internal Python call! By the way, that hook.c comment was wondering whether there might be a nicer (more nearly portable?) way to set-up these assembly sections. Some of this stuff was hacked together, but I have a couple other games I want to play with this gimmick, and I want to make the hooking a bit better. https://github.com/dutc/libhook https://github.com/dutc/libhook