Skip to content
Permalink
Browse files
Python3 typemap fix (#5989)
* Ensure py3 correctly tested

* Fix custom typemap for py3

* Fix typo
  • Loading branch information
geographika committed Feb 10, 2020
1 parent edafd27 commit 9acb20060d43cade4b3d8d22548b1033360d6bbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
@@ -53,8 +53,6 @@ build_script:
- set SDK_BIN=%BUILD_FOLDER%/sdk/%SDK%/bin
- set SWIG_EXECUTABLE=%BUILD_FOLDER%/sdk/%SWIG_VER%/swig.exe
- set REGEX_DIR=%BUILD_FOLDER%/sdk/regex-0.12
- if "%platform%" == "x86" SET PYTHON_EXECUTABLE=c:/python27/python.exe
- if "%platform%" == "x64" SET PYTHON_EXECUTABLE=c:/python27-x64/python.exe
- cd %BUILD_FOLDER%
- mkdir build
- cd build
@@ -113,8 +113,13 @@ CreateTupleFromDoubleArray( double *first, unsigned int size ) {
PyObject* key = PyList_GetItem(keys, i);
PyObject* val = PyList_GetItem(values, i);

$1[i] = PyString_AsString(key);
$2[i] = PyString_AsString(val);
%#if PY_MAJOR_VERSION >= 3
$1[i] = PyUnicode_AsUTF8(key);
$2[i] = PyUnicode_AsUTF8(val);
%#else
$1[i] = PyString_AsString(key);
$2[i] = PyString_AsString(val);
%#endif
}

$1[i] = 0;

0 comments on commit 9acb200

Please sign in to comment.