阅读背景:

从C API访问Python回溯。

来源:互联网 

I'm having some trouble figuring out the proper way to walk a Python traceback using the C API. I'm writing an application that embeds the Python interpreter. I want to be able to execute arbitrary Python code, and if it raises an exception, to translate it to my own application-specific C++ exception. For now, it is sufficient to extract just the file name and line number where the Python exception was raised. This is what I have so far:I'm having some trouble figuring out the proper




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: