| 3427 | } |
| 3428 | |
| 3429 | void |
| 3430 | AppManager::launchPythonInterpreter() |
| 3431 | { |
| 3432 | std::string err; |
| 3433 | std::string s = "app = app1\n"; |
| 3434 | bool ok = NATRON_PYTHON_NAMESPACE::interpretPythonScript(s, &err, 0); |
| 3435 | |
| 3436 | assert(ok); |
| 3437 | if (!ok) { |
| 3438 | throw std::runtime_error("AppInstance::launchPythonInterpreter(): interpretPythonScript(" + s + " failed!"); |
| 3439 | } |
| 3440 | |
| 3441 | // PythonGILLocker pgl; |
| 3442 | #if PY_MAJOR_VERSION >= 3 |
| 3443 | // Python 3 |
| 3444 | Py_Main(1, &_imp->commandLineArgsWide[0]); |
| 3445 | #else |
| 3446 | Py_Main(1, &_imp->commandLineArgsUtf8[0]); |
| 3447 | #endif |
| 3448 | |
| 3449 | } |
| 3450 | |
| 3451 | int |
| 3452 | AppManager::isProjectAlreadyOpened(const std::string& projectFilePath) const |