79231954

Date: 2024-11-27 21:43:34
Score: 1
Natty:
Report link

The pyo3_runtime.PanicException inherits from Python's BaseException, so using BaseException in the try:except block successfully catches the panic. It's quite a broad sweep but will do in a pinch.

See another SO q&a here

See the pyo3 docs here

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: skytwosea