From b0d351e0a551460d890a61c3bf9a6971fa7097c5 Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Thu, 20 Nov 2014 22:31:29 +0900 Subject: [PATCH] Revise example/wrap.cpp for python3 --- libs/numpy/example/wrap.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/numpy/example/wrap.cpp b/libs/numpy/example/wrap.cpp index 06a8d552ab..5d2027ebdb 100644 --- a/libs/numpy/example/wrap.cpp +++ b/libs/numpy/example/wrap.cpp @@ -111,8 +111,11 @@ BOOST_PYTHON_MODULE(example) { int main(int argc, char **argv) { // This line makes our module available to the embedded Python intepreter. - PyImport_AppendInittab("example", &initexample); - +# if PY_VERSION_HEX >= 0x03000000 + PyImport_AppendInittab("example", &PyInit_example); +# else + PyImport_AppendInittab("example", &initexample); +# endif // Initialize the Python runtime. Py_Initialize();