[CheckGeometry] fix python2 build

This commit is contained in:
mwganson
2020-07-29 01:38:20 -05:00
committed by Yorik van Havre
parent 1b8a410d29
commit 9bb3b0e046

View File

@@ -326,7 +326,7 @@ std::string InterpreterSingleton::runStringWithKey(const char *psCmd, const char
#if PY_MAJOR_VERSION >= 3
PyObject* str = PyUnicode_AsEncodedString(key_return_value, "utf-8", "~E~");
#else
PyObject* str = PyString_FromString(key_return_value);
PyObject* str = PyObject_Str(key_return_value);
#endif
const char* result = PyBytes_AS_STRING(str);
return result;