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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user