From 70ee460a1445912f57d233bfae60f71fdf7b1dea Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 24 May 2005 12:20:03 +0000 Subject: [PATCH] Py_Initialize outside the first test routine [SVN r29167] --- test/embedding.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/embedding.cpp b/test/embedding.cpp index 1ac8e601..acd1f180 100644 --- a/test/embedding.cpp +++ b/test/embedding.cpp @@ -63,10 +63,6 @@ void test() if (PyImport_AppendInittab("embedded_hello", initembedded_hello) == -1) throw std::runtime_error("Failed to add embedded_hello to the interpreter's " "builtin modules"); - - // Initialize the interpreter - Py_Initialize(); - // Retrieve the main module python::object main_module(( python::handle<>(python::borrowed(PyImport_AddModule("__main__"))))); @@ -169,6 +165,9 @@ test_tutorial2() int main() { + // Initialize the interpreter + Py_Initialize(); + if (python::handle_exception(test)) { if (PyErr_Occurred()) @@ -190,6 +189,8 @@ int main() return 1; } + // Boost.Python doesn't support Py_Finalize yet. + // Py_Finalize(); return 0; } #include "module_tail.cpp"