summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-geosciences/mapnik/files/mapnik-2.2.0-python3.patch')
-rw-r--r--sci-geosciences/mapnik/files/mapnik-2.2.0-python3.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/sci-geosciences/mapnik/files/mapnik-2.2.0-python3.patch b/sci-geosciences/mapnik/files/mapnik-2.2.0-python3.patch
new file mode 100644
index 000000000000..4266f624070d
--- /dev/null
+++ b/sci-geosciences/mapnik/files/mapnik-2.2.0-python3.patch
@@ -0,0 +1,16 @@
+diff --git a/bindings/python/mapnik_datasource.cpp b/bindings/python/mapnik_datasource.cpp
+index 07383b3..85e2ff7 100644
+--- a/bindings/python/mapnik_datasource.cpp
++++ b/bindings/python/mapnik_datasource.cpp
+@@ -61,7 +61,11 @@ boost::shared_ptr<mapnik::datasource> 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);
+ }