mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Python - remove 2.x only code paths
This commit is contained in:
parent
4ffc8bbb8e
commit
0eb0b922d7
@ -35,12 +35,7 @@ SCM scm_init_unittest_support_module (void);
|
|||||||
#if defined(SWIGPYTHON)
|
#if defined(SWIGPYTHON)
|
||||||
%{
|
%{
|
||||||
/* avoid no previous prototype warning/error */
|
/* avoid no previous prototype warning/error */
|
||||||
#if PY_VERSION_HEX >= 0x03000000
|
PyObject* SWIG_init (void);
|
||||||
PyObject*
|
|
||||||
#else
|
|
||||||
void
|
|
||||||
#endif
|
|
||||||
SWIG_init (void);
|
|
||||||
%}
|
%}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -57,13 +57,8 @@ libgncmod_python_gnc_module_description(void)
|
|||||||
return g_strdup("An embedded Python interpreter");
|
return g_strdup("An embedded Python interpreter");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if PY_VERSION_HEX >= 0x03000000
|
|
||||||
//extern PyObject* PyInit__sw_app_utils(void);
|
//extern PyObject* PyInit__sw_app_utils(void);
|
||||||
//extern PyObject* PyInit__sw_core_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
|
int
|
||||||
libgncmod_python_gnc_module_init(int refcount)
|
libgncmod_python_gnc_module_init(int refcount)
|
||||||
@ -73,23 +68,15 @@ libgncmod_python_gnc_module_init(int refcount)
|
|||||||
*/
|
*/
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
gchar *pkgdatadir, *init_filename;
|
gchar *pkgdatadir, *init_filename;
|
||||||
#if PY_VERSION_HEX >= 0x03000000
|
|
||||||
wchar_t* argv = NULL;
|
wchar_t* argv = NULL;
|
||||||
#else
|
|
||||||
char* argv = "";
|
|
||||||
#endif
|
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
PySys_SetArgv(0, &argv);
|
PySys_SetArgv(0, &argv);
|
||||||
// I don't quite understand why these are loaded here
|
// I don't quite understand why these are loaded here
|
||||||
// - these are python modules so should be able to just import them
|
// - these are python modules so should be able to just import them
|
||||||
// in init.py
|
// in init.py
|
||||||
#if PY_VERSION_HEX >= 0x03000000
|
|
||||||
//PyInit__sw_app_utils();
|
//PyInit__sw_app_utils();
|
||||||
//PyInit__sw_core_utils();
|
//PyInit__sw_core_utils();
|
||||||
#else
|
|
||||||
//init_sw_app_utils();
|
|
||||||
//init_sw_core_utils();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* There isn't yet a python module to init.
|
/* There isn't yet a python module to init.
|
||||||
pName = PyString_FromString("path/to/init.py");
|
pName = PyString_FromString("path/to/init.py");
|
||||||
|
@ -49,12 +49,7 @@ SCM scm_init_sw_app_utils_module (void);
|
|||||||
#if defined(SWIGPYTHON)
|
#if defined(SWIGPYTHON)
|
||||||
%{
|
%{
|
||||||
/* avoid no previous prototype warning/error */
|
/* avoid no previous prototype warning/error */
|
||||||
#if PY_VERSION_HEX >= 0x03000000
|
PyObject* SWIG_init (void);
|
||||||
PyObject*
|
|
||||||
#else
|
|
||||||
void
|
|
||||||
#endif
|
|
||||||
SWIG_init (void);
|
|
||||||
%}
|
%}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -39,12 +39,7 @@ SCM scm_init_sw_core_utils_module (void);
|
|||||||
#endif
|
#endif
|
||||||
#if defined(SWIGPYTHON)
|
#if defined(SWIGPYTHON)
|
||||||
%{
|
%{
|
||||||
#if PY_VERSION_HEX >= 0x03000000
|
PyObject* SWIG_init (void);
|
||||||
PyObject*
|
|
||||||
#else
|
|
||||||
void
|
|
||||||
#endif
|
|
||||||
SWIG_init (void);
|
|
||||||
%}
|
%}
|
||||||
#endif
|
#endif
|
||||||
%import "base-typemaps.i"
|
%import "base-typemaps.i"
|
||||||
|
Loading…
Reference in New Issue
Block a user