Commit 063abbff authored by Laurent Claustre's avatar Laurent Claustre Committed by Samuel Debionne

missing Python.h for getting the right version

parent 413783e2
Pipeline #5840 passed with stages
in 16 minutes and 25 seconds
......@@ -679,13 +679,22 @@ void limacore_import_array();
%End
%UnitCode
#include <Python.h>
#if PY_MAJOR_VERSION >= 3
#ifndef LIMA_REPR_CODE
#define LIMA_REPR_CODE \
std::ostringstream str; \
str << *sipCpp; \
const std::string& tmpString = str.str(); \
sipRes = PyUnicode_FromString(tmpString.c_str());
#else
#define LIMA_REPR_CODE \
std::ostringstream str; \
str << *sipCpp; \
const std::string& tmpString = str.str(); \
sipRes = PyString_FromString(tmpString.c_str());
#endif
#endif
%End
%PostInitialisationCode
......
......@@ -37,13 +37,22 @@ void lima@NAME@_import_array();
%UnitCode
#include <Python.h>
#ifndef LIMA_REPR_CODE
#if PY_MAJOR_VERSION >= 3
#define LIMA_REPR_CODE \
std::ostringstream str; \
str << *sipCpp; \
const std::string& tmpString = str.str(); \
sipRes = PyUnicode_FromString(tmpString.c_str());
#else
#define LIMA_REPR_CODE \
std::ostringstream str; \
str << *sipCpp; \
const std::string& tmpString = str.str(); \
sipRes = PyString_FromString(tmpString.c_str());
#endif
#endif
%End
%PostInitialisationCode
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment