Python - remove 2.x only code paths

This commit is contained in:
Geert Janssens 2019-10-01 16:27:28 +02:00
parent 4ffc8bbb8e
commit 0eb0b922d7
4 changed files with 4 additions and 32 deletions

View File

@ -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

View File

@ -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");

View File

@ -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

View File

@ -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"