Skip to content
Snippets Groups Projects
Commit f9645ad3 authored by Daniel Savchenko's avatar Daniel Savchenko
Browse files

some adjustments

parent 6cfa86c0
No related branches found
No related tags found
2 merge requests!265Mac fix,!264Mac fix
...@@ -124,7 +124,7 @@ void PythonInterpreter::initPython() { ...@@ -124,7 +124,7 @@ void PythonInterpreter::initPython() {
std::cerr << "Initialize Threads ..."; std::cerr << "Initialize Threads ...";
//#endif //#endif
//PyEval_InitThreads(); PyEval_InitThreads();
//#ifdef PYTHON_DEBUG //#ifdef PYTHON_DEBUG
std::cerr << " Done" << std::endl; std::cerr << " Done" << std::endl;
...@@ -166,8 +166,15 @@ void PythonInterpreter::initPython() { ...@@ -166,8 +166,15 @@ void PythonInterpreter::initPython() {
std::cerr << "Importing OpenFlipper core module ..."; std::cerr << "Importing OpenFlipper core module ...";
//#endif //#endif
try{
py::module of_module(py::module::import("openflipper")); py::module of_module(py::module::import("openflipper"));
main_namespace["openflipper"] = of_module; main_namespace["openflipper"] = of_module;
}
catch (py::error_already_set &e)
{
pyError(e.what());
return;
}
//#ifdef PYTHON_DEBUG //#ifdef PYTHON_DEBUG
std::cerr << " Done" << std::endl; std::cerr << " Done" << std::endl;
...@@ -272,13 +279,13 @@ bool PythonInterpreter::runScript(const QString& _script) { ...@@ -272,13 +279,13 @@ bool PythonInterpreter::runScript(const QString& _script) {
{ {
//#ifdef PYTHON_DEBUG //#ifdef PYTHON_DEBUG
std::cerr << "Initialize Python" << std::endl; std::cout << "Initialize Python" << std::endl;
//#endif //#endif
initPython(); initPython();
//#ifdef PYTHON_DEBUG //#ifdef PYTHON_DEBUG
std::cerr << "Done initializing Python" << std::endl; std::cout << "Done initializing Python" << std::endl;
//#endif //#endif
} }
catch (py::error_already_set &e) catch (py::error_already_set &e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment