diff options
Diffstat (limited to 'dummy/main.cc')
-rw-r--r-- | dummy/main.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/dummy/main.cc b/dummy/main.cc index de578ca3..d025d8d4 100644 --- a/dummy/main.cc +++ b/dummy/main.cc @@ -92,11 +92,6 @@ int main(int argc, char *argv[]) Context ctx(ArchArgs{}); -#ifndef NO_PYTHON - init_python(argv[0]); - python_export_global("ctx", ctx); -#endif - if (vm.count("verbose")) { ctx.verbose = true; } @@ -111,9 +106,14 @@ int main(int argc, char *argv[]) #ifndef NO_PYTHON if (vm.count("run")) { + init_python(argv[0], true); + python_export_global("ctx", ctx); + std::vector<std::string> files = vm["run"].as<std::vector<std::string>>(); for (auto filename : files) execute_python_file(filename.c_str()); + + deinit_python(); } #endif @@ -126,9 +126,6 @@ int main(int argc, char *argv[]) rc = a.exec(); } #endif -#ifndef NO_PYTHON - deinit_python(); -#endif return rc; } catch (log_execution_error_exception) { #if defined(_MSC_VER) |