From fbeeb54558e2853e4976870cb4a53dd4844ca402 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 6 Jun 2013 13:11:34 -0700 Subject: [PATCH] fix compile with python 3.x --- bindings/python/mapnik_datasource.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bindings/python/mapnik_datasource.cpp b/bindings/python/mapnik_datasource.cpp index 07383b372..85e2ff721 100644 --- a/bindings/python/mapnik_datasource.cpp +++ b/bindings/python/mapnik_datasource.cpp @@ -61,7 +61,11 @@ boost::shared_ptr create_datasource(dict const& d) PyObject* temp = PyUnicode_AsUTF8String(obj.ptr()); if (temp) { +#if PY_VERSION_HEX >= 0x03000000 + char* c_str = PyBytes_AsString(temp); +#else char* c_str = PyString_AsString(temp); +#endif params[key] = std::string(c_str); Py_DecRef(temp); }