I have a C++ code which executes Python script using the PyRun_SimpleFileEx C API.
The py file looks like this
import time
time.sleep(2)
raise SystemExit("Sorry, it is time to exit.")
SystemExit is what is also raised by calling python stuff like either quit() or abort()
Since SystemExit inherits from BaseException instead of Exception it is not catched and shuts-off the Python environment as well as the C++ application.
Is there any way to catch the exception above from C++?
Thanks in advance All the best MB