Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | From 323ced03a66e6cd963d8277b66cfcc7dce740be7 Mon Sep 17 00:00:00 2001 |
| 2 | From: Lei Maohui <leimaohui@cn.fujitsu.com> |
| 3 | Date: Fri, 17 Jul 2015 01:33:43 -0700 |
| 4 | Subject: [PATCH] fix Xthe build error when python>3.0 |
| 5 | |
| 6 | Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com> |
| 7 | --- |
| 8 | src/target_python.c | 7 ++++++- |
| 9 | 1 file changed, 6 insertions(+), 1 deletion(-) |
| 10 | |
| 11 | diff --git a/src/target_python.c b/src/target_python.c |
| 12 | index 90b43a1..2b76c9e 100644 |
| 13 | --- a/src/target_python.c |
| 14 | +++ b/src/target_python.c |
| 15 | @@ -167,7 +167,12 @@ PyGlobalInitialize(const CMPIBroker* broker, CMPIStatus* st) |
| 16 | |
| 17 | Py_SetProgramName("cmpi_swig"); |
| 18 | Py_Initialize(); |
| 19 | - SWIGEXPORT void SWIG_init(void); |
| 20 | +#if PY_VERSION_HEX >= 0x03000000 |
| 21 | +SWIGEXPORT PyObject* |
| 22 | +#else |
| 23 | + SWIGEXPORT void |
| 24 | +#endif |
| 25 | + SWIG_init(void); |
| 26 | SWIG_init(); |
| 27 | cmpiMainPyThreadState = PyGILState_GetThisThreadState(); |
| 28 | PyEval_ReleaseThread(cmpiMainPyThreadState); |
| 29 | -- |
| 30 | 2.1.0 |
| 31 | |