diff --git a/common/test-core/unittest-support.i b/common/test-core/unittest-support.i index 948a5548a8..fe48bfec90 100644 --- a/common/test-core/unittest-support.i +++ b/common/test-core/unittest-support.i @@ -35,12 +35,7 @@ SCM scm_init_unittest_support_module (void); #if defined(SWIGPYTHON) %{ /* avoid no previous prototype warning/error */ -#if PY_VERSION_HEX >= 0x03000000 -PyObject* -#else -void -#endif -SWIG_init (void); +PyObject* SWIG_init (void); %} #endif diff --git a/gnucash/python/gncmod-python.c b/gnucash/python/gncmod-python.c index ea314daba9..f287693274 100644 --- a/gnucash/python/gncmod-python.c +++ b/gnucash/python/gncmod-python.c @@ -57,13 +57,8 @@ libgncmod_python_gnc_module_description(void) return g_strdup("An embedded Python interpreter"); } -#if PY_VERSION_HEX >= 0x03000000 //extern PyObject* PyInit__sw_app_utils(void); //extern PyObject* PyInit__sw_core_utils(void); -#else -//extern void init_sw_app_utils(void); -//extern void init_sw_core_utils(void); -#endif int libgncmod_python_gnc_module_init(int refcount) @@ -73,23 +68,15 @@ libgncmod_python_gnc_module_init(int refcount) */ FILE *fp; gchar *pkgdatadir, *init_filename; -#if PY_VERSION_HEX >= 0x03000000 wchar_t* argv = NULL; -#else - char* argv = ""; -#endif + Py_Initialize(); PySys_SetArgv(0, &argv); // I don't quite understand why these are loaded here // - these are python modules so should be able to just import them // in init.py -#if PY_VERSION_HEX >= 0x03000000 //PyInit__sw_app_utils(); //PyInit__sw_core_utils(); -#else - //init_sw_app_utils(); - //init_sw_core_utils(); -#endif /* There isn't yet a python module to init. pName = PyString_FromString("path/to/init.py"); diff --git a/libgnucash/app-utils/app-utils.i b/libgnucash/app-utils/app-utils.i index 7ded4efa82..d09b4ee10c 100644 --- a/libgnucash/app-utils/app-utils.i +++ b/libgnucash/app-utils/app-utils.i @@ -49,12 +49,7 @@ SCM scm_init_sw_app_utils_module (void); #if defined(SWIGPYTHON) %{ /* avoid no previous prototype warning/error */ -#if PY_VERSION_HEX >= 0x03000000 -PyObject* -#else -void -#endif -SWIG_init (void); +PyObject* SWIG_init (void); %} #endif diff --git a/libgnucash/core-utils/core-utils.i b/libgnucash/core-utils/core-utils.i index 234cb04890..9a5eaf530d 100644 --- a/libgnucash/core-utils/core-utils.i +++ b/libgnucash/core-utils/core-utils.i @@ -39,12 +39,7 @@ SCM scm_init_sw_core_utils_module (void); #endif #if defined(SWIGPYTHON) %{ -#if PY_VERSION_HEX >= 0x03000000 -PyObject* -#else -void -#endif - SWIG_init (void); +PyObject* SWIG_init (void); %} #endif %import "base-typemaps.i"