mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Handle Exceptions in main & Pythoninit (#601)
This commit is contained in:
@@ -19,6 +19,11 @@ PythonInit::PythonInit()
|
||||
// init Python
|
||||
Debug(Logger::getInstance("DAEMON"), "Initializing Python interpreter");
|
||||
Py_InitializeEx(0);
|
||||
if ( !Py_IsInitialized() )
|
||||
{
|
||||
throw std::runtime_error("Initializing Python failed!");
|
||||
}
|
||||
|
||||
PyEval_InitThreads(); // Create the GIL
|
||||
mainThreadState = PyEval_SaveThread();
|
||||
}
|
||||
|
Reference in New Issue
Block a user