How do I properly use Python's C API and exceptions?

前端 未结 2 1514
执念已碎
执念已碎 2021-01-04 03:39

if I do something like

 >>> x = int(1,2,3,4,5)

I immediately get a fatal error (one that would end program execution if it was in

2条回答
  •  执念已碎
    2021-01-04 04:00

    Raising an exception in C is done by setting the exception object or string and then returning NULL from the function.

提交回复
热议问题