diff --git a/PythonInterpreter/PythonInterpreter.cc b/PythonInterpreter/PythonInterpreter.cc index 315999fbab0975a00fad46a8c105670d6873a105..42fefd16e40ed846e4222a2c1604968d6bcac8ff 100644 --- a/PythonInterpreter/PythonInterpreter.cc +++ b/PythonInterpreter/PythonInterpreter.cc @@ -124,7 +124,7 @@ void PythonInterpreter::initPython() { std::cerr << "Initialize Threads ..."; //#endif - //PyEval_InitThreads(); + PyEval_InitThreads(); //#ifdef PYTHON_DEBUG std::cerr << " Done" << std::endl; @@ -166,8 +166,15 @@ void PythonInterpreter::initPython() { std::cerr << "Importing OpenFlipper core module ..."; //#endif - py::module of_module(py::module::import("openflipper")); - main_namespace["openflipper"] = of_module; + try{ + py::module of_module(py::module::import("openflipper")); + main_namespace["openflipper"] = of_module; + } + catch (py::error_already_set &e) + { + pyError(e.what()); + return; + } //#ifdef PYTHON_DEBUG std::cerr << " Done" << std::endl; @@ -272,13 +279,13 @@ bool PythonInterpreter::runScript(const QString& _script) { { //#ifdef PYTHON_DEBUG - std::cerr << "Initialize Python" << std::endl; + std::cout << "Initialize Python" << std::endl; //#endif initPython(); //#ifdef PYTHON_DEBUG - std::cerr << "Done initializing Python" << std::endl; + std::cout << "Done initializing Python" << std::endl; //#endif } catch (py::error_already_set &e)