{LYN-4372} fix for Python exit crash (#1600)

There is a crash when sys.exit() was being called since embedded Python
should not have control of the application lifetime. The Py_InspectFlag
puts the Python VM into 'inspection mode' which prevents the app
shutdown when any sys.exit() is invoked.

Notes:
* skips 'regset' extra command line in PythonBindingsExample
* added methods for handling PythonBindingsExample errors

Test: added Application_SystemExit_Blocked and
fixed up Application_Run_Fails now is Application_Run_Works
This commit is contained in:
jackalbe
2021-06-28 10:28:49 -05:00
committed by GitHub
parent 9d9ff751b6
commit 580bd11715
4 changed files with 52 additions and 2 deletions
@@ -60,6 +60,10 @@ PythonBindingsExample.exe --file path/to/file.py --arg one --arg two
{
m_interactiveMode = true;
}
else if (switchItem.m_option.starts_with("regset"))
{
// skip
}
else
{
AZ_Warning("python_app", false, "Unknown switch %s \n", switchItem.m_option.c_str());