2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-22 05:22:45 +00:00

Py_Initialize outside the first test routine

[SVN r29167]
This commit is contained in:
Dave Abrahams
2005-05-24 12:20:03 +00:00
parent 07c95aea4e
commit 70ee460a14

View File

@@ -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"