mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
py3k -- PyUnicode_FromString instead of PyString_fromString
This commit is contained in:
parent
014ca1497d
commit
a7488d287e
9
_webp.c
9
_webp.c
|
@ -114,7 +114,7 @@ PyObject* WebPDecode_wrapper(PyObject* self, PyObject* args)
|
|||
PyBytesObject *webp_string;
|
||||
uint8_t *webp;
|
||||
Py_ssize_t size;
|
||||
PyObject *ret, *bytes;
|
||||
PyObject *ret, *bytes, *pymode;
|
||||
WebPDecoderConfig config;
|
||||
VP8StatusCode vp8_status_code = VP8_STATUS_OK;
|
||||
char* mode = "RGB";
|
||||
|
@ -157,8 +157,13 @@ PyObject* WebPDecode_wrapper(PyObject* self, PyObject* args)
|
|||
config.output.u.YUVA.y_size);
|
||||
}
|
||||
|
||||
#if PY_VERSION_HEX >= 0x03000000
|
||||
pymode = PyUnicode_FromString(mode);
|
||||
#else
|
||||
pymode = PyString_FromString(mode);
|
||||
#endif
|
||||
ret = Py_BuildValue("SiiS", bytes, config.output.width,
|
||||
config.output.height, PyBytes_FromString(mode));
|
||||
config.output.height, pymode);
|
||||
WebPFreeDecBuffer(&config.output);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user