Initial Python 3 port
Many things work, some don't. Notably, genPOI doesn't work, and there's some signedness comparison stuff going on in the C extension. This also completely drops support for Python 2, as maintaining a C extension for both Python 2 and 3 is a pain and not worth it for the 9 months that Python 2 is still going to be supported upstream. The documentation needs to be adjusted as well. All of the few tests we have pass, and rendering a map works, both with a configuration file and without. We can also use optimizeimages. Concerns #1528.
This commit is contained in:
@@ -52,9 +52,9 @@ hide_start(void *data, RenderState *state, PyObject *support) {
|
||||
for (i = 0; i < blocks_size; i++) {
|
||||
PyObject *block = PyList_GET_ITEM(opt, i);
|
||||
|
||||
if (PyInt_Check(block)) {
|
||||
if (PyLong_Check(block)) {
|
||||
/* format 1: just a block id */
|
||||
self->rules[i].blockid = PyInt_AsLong(block);
|
||||
self->rules[i].blockid = PyLong_AsLong(block);
|
||||
self->rules[i].has_data = 0;
|
||||
} else if (PyArg_ParseTuple(block, "Hb", &(self->rules[i].blockid), &(self->rules[i].data))) {
|
||||
/* format 2: (blockid, data) */
|
||||
|
||||
Reference in New Issue
Block a user