diff --git a/_imagingcms.c b/_imagingcms.c index 910dc6eeb..65958f33a 100644 --- a/_imagingcms.c +++ b/_imagingcms.c @@ -501,9 +501,8 @@ cms_get_display_profile_win32(PyObject* self, PyObject* args) static PyMethodDef pyCMSdll_methods[] = { {"profile_open", cms_profile_open, 1}, -#if PY_VERSION_HEX >= 0x03000000 {"profile_frombytes", cms_profile_fromstring, 1}, -#else +#if PY_VERSION_HEX < 0x03000000 {"profile_fromstring", cms_profile_fromstring, 1}, #endif diff --git a/display.c b/display.c index 9571b1cbe..1ce537c64 100644 --- a/display.c +++ b/display.c @@ -180,7 +180,7 @@ _releasedc(ImagingDisplayObject* display, PyObject* args) } static PyObject* -_fromstring(ImagingDisplayObject* display, PyObject* args) +_frombytes(ImagingDisplayObject* display, PyObject* args) { char* ptr; int bytes; @@ -205,7 +205,7 @@ _fromstring(ImagingDisplayObject* display, PyObject* args) } static PyObject* -_tostring(ImagingDisplayObject* display, PyObject* args) +_tobytes(ImagingDisplayObject* display, PyObject* args) { #if PY_VERSION_HEX >= 0x03000000 if (!PyArg_ParseTuple(args, ":tobytes")) @@ -227,12 +227,11 @@ static struct PyMethodDef methods[] = { {"query_palette", (PyCFunction)_query_palette, 1}, {"getdc", (PyCFunction)_getdc, 1}, {"releasedc", (PyCFunction)_releasedc, 1}, -#if PY_VERSION_HEX >= 0x03000000 - {"frombytes", (PyCFunction)_fromstring, 1}, - {"tobytes", (PyCFunction)_tostring, 1}, -#else - {"fromstring", (PyCFunction)_fromstring, 1}, - {"tostring", (PyCFunction)_tostring, 1}, + {"frombytes", (PyCFunction)_frombytes, 1}, + {"tobytes", (PyCFunction)_tobytes, 1}, +#if PY_VERSION_HEX < 0x03000000 + {"fromstring", (PyCFunction)_frombytes, 1}, + {"tostring", (PyCFunction)_tobytes, 1}, #endif {NULL, NULL} /* sentinel */ };