mirror of
https://github.com/boostorg/python.git
synced 2026-01-24 06:02:14 +00:00
Revise example/wrap.cpp for python3
This commit is contained in:
committed by
Jim Bosch
parent
e2c23fd5f9
commit
4c2070f39f
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user