fix compile with python 3.x
This commit is contained in:
parent
60b4f42891
commit
fbeeb54558
1 changed files with 4 additions and 0 deletions
|
@ -61,7 +61,11 @@ boost::shared_ptr<mapnik::datasource> create_datasource(dict const& d)
|
||||||
PyObject* temp = PyUnicode_AsUTF8String(obj.ptr());
|
PyObject* temp = PyUnicode_AsUTF8String(obj.ptr());
|
||||||
if (temp)
|
if (temp)
|
||||||
{
|
{
|
||||||
|
#if PY_VERSION_HEX >= 0x03000000
|
||||||
|
char* c_str = PyBytes_AsString(temp);
|
||||||
|
#else
|
||||||
char* c_str = PyString_AsString(temp);
|
char* c_str = PyString_AsString(temp);
|
||||||
|
#endif
|
||||||
params[key] = std::string(c_str);
|
params[key] = std::string(c_str);
|
||||||
Py_DecRef(temp);
|
Py_DecRef(temp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue