From e9da6811a65f1ca8c3e2829d0e28b6a71b1a50e0 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Sat, 4 Aug 2018 12:03:37 +0200 Subject: [PATCH] Fix initialisation of the pcbnew python module --- pcbnew/swig/python_scripting.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pcbnew/swig/python_scripting.cpp b/pcbnew/swig/python_scripting.cpp index 9bc46e17f4..6617c466be 100644 --- a/pcbnew/swig/python_scripting.cpp +++ b/pcbnew/swig/python_scripting.cpp @@ -42,9 +42,7 @@ /* init functions defined by swig */ #if PY_MAJOR_VERSION >= 3 -extern "C" PyObject* init_kicad( void ); - -extern "C" PyObject* init_pcbnew( void ); +extern "C" PyObject* PyInit__pcbnew( void ); #else extern "C" void init_kicad( void ); @@ -120,7 +118,11 @@ static void swigAddBuiltin() static void swigAddModules() { +#if PY_MAJOR_VERSION >= 3 + swigAddModule( "_pcbnew", PyInit__pcbnew ); +#else swigAddModule( "_pcbnew", init_pcbnew ); +#endif // finally it seems better to include all in just one module // but in case we needed to include any other modules,