Skip to content

Commit

Permalink
Fix exception handle on Python 3.11 or older
Browse files Browse the repository at this point in the history
  • Loading branch information
o01eg committed Jan 22, 2024
1 parent 864c03a commit 373998f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion util/PythonCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ void PythonCommon::HandleErrorAlreadySet() {
return;
}

PyErr_Print();
#if PY_VERSION_HEX < 0x030c0000
PyObject *extype, *value, *traceback;
PyErr_Fetch(&extype, &value, &traceback);
Expand All @@ -102,6 +101,8 @@ void PythonCommon::HandleErrorAlreadySet() {
boost::algorithm::trim_right(line);
ErrorLogger() << line;
}
#else
PyErr_Print();
#endif
return;
}
Expand Down

0 comments on commit 373998f

Please sign in to comment.