MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / launchPythonInterpreter

Method launchPythonInterpreter

Engine/AppManager.cpp:3132–3157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3130}
3131
3132void
3133AppManager::launchPythonInterpreter()
3134{
3135 std::string err;
3136 std::string s = "app = app1\n";
3137 bool ok = NATRON_PYTHON_NAMESPACE::interpretPythonScript(s, &err, 0);
3138
3139 assert(ok);
3140 if (!ok) {
3141 throw std::runtime_error("AppInstance::launchPythonInterpreter(): interpretPythonScript(" + s + " failed!");
3142 }
3143
3144 PyGILState_Ensure(); // Py_Main does PyGILState_Release() for us.
3145
3146 assert(PyThreadState_Get());
3147#if PY_VERSION_HEX >= 0x030400F0
3148 assert(PyGILState_Check()); // Not available prior to Python 3.4
3149#endif
3150
3151#if PY_MAJOR_VERSION >= 3
3152 // Python 3
3153 Py_Main(1, &_imp->commandLineArgsWide[0]);
3154#else
3155 Py_Main(1, &_imp->commandLineArgsUtf8[0]);
3156#endif
3157}
3158
3159int
3160AppManager::isProjectAlreadyOpened(const std::string& projectFilePath) const

Callers 1

loadInternalMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected