Skip to content

Commit dc16692

Browse files
author
Roberto De Ioris
committed
manage SystemExit exception
1 parent ca07c3f commit dc16692

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎Source/UnrealEnginePython/Private/UnrealEnginePython.cpp‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,11 @@ void FUnrealEnginePythonModule::RunString(char *str)
448448
PyObject *eval_ret = PyRun_String(str, Py_file_input, (PyObject *)main_dict, (PyObject *)local_dict);
449449
if (!eval_ret)
450450
{
451+
if (PyErr_ExceptionMatches(PyExc_SystemExit))
452+
{
453+
PyErr_Clear();
454+
return;
455+
}
451456
unreal_engine_py_log_error();
452457
return;
453458
}
@@ -566,6 +571,11 @@ void FUnrealEnginePythonModule::RunFile(char *filename)
566571
fclose(fd);
567572
if (!eval_ret)
568573
{
574+
if (PyErr_ExceptionMatches(PyExc_SystemExit))
575+
{
576+
PyErr_Clear();
577+
return;
578+
}
569579
unreal_engine_py_log_error();
570580
return;
571581
}
@@ -576,6 +586,11 @@ void FUnrealEnginePythonModule::RunFile(char *filename)
576586
PyObject *eval_ret = PyRun_String(TCHAR_TO_UTF8(*command), Py_file_input, (PyObject *)main_dict, (PyObject *)local_dict);
577587
if (!eval_ret)
578588
{
589+
if (PyErr_ExceptionMatches(PyExc_SystemExit))
590+
{
591+
PyErr_Clear();
592+
return;
593+
}
579594
unreal_engine_py_log_error();
580595
return;
581596
}

0 commit comments

Comments
 (0)