pythonly得到引发异常的行号

时间:2019-06-19 12:39:53

标签: python python-3.x exception

我该怎么做?

我很想找到一些免费的代码,它们可以报告有关异常的尽可能多的信息,但是我没有,所以我想出了

except Exception as e:
    print('Error, undetected exception in function ' + inspect.currentframe().f_code.co_name)
    print(str(e))
    traceback.print_exc()
    os._exit(1)

我如何得知引发异常的那一行?

0 个答案:

没有答案
相关问题