From b479de9e969e800c6d93daa11d4bd819229135ba Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 12 Mar 2013 18:42:42 -0700 Subject: [PATCH] fix compile with python >=3 --- bindings/python/mapnik_layer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bindings/python/mapnik_layer.cpp b/bindings/python/mapnik_layer.cpp index f3584a0ac..4656a5217 100644 --- a/bindings/python/mapnik_layer.cpp +++ b/bindings/python/mapnik_layer.cpp @@ -117,10 +117,14 @@ void set_buffer_size(mapnik::layer & l, boost::optional const& buffer_size) PyObject * get_buffer_size(mapnik::layer & l) { - boost::optional buffer_size = l.buffer_size(); + boost::optional buffer_size = l.buffer_size(); if (buffer_size) { +#if PY_VERSION_HEX >= 0x03000000 + return PyLong_FromLong(*buffer_size); +#else return PyInt_FromLong(*buffer_size); +#endif } else {