diff --git a/plugins/python/uwsgi_pymodule.c b/plugins/python/uwsgi_pymodule.c index 300b2754..f1b7626e 100644 --- a/plugins/python/uwsgi_pymodule.c +++ b/plugins/python/uwsgi_pymodule.c @@ -1480,7 +1480,11 @@ PyObject *py_uwsgi_sharedarea_read(PyObject * self, PyObject * args) { } PyObject *ret = PyString_FromStringAndSize(NULL, len); +#ifdef PYTHREE + char *storage = PyBytes_AsString(ret); +#else char *storage = PyString_AS_STRING(ret); +#endif UWSGI_RELEASE_GIL @@ -3518,7 +3522,11 @@ PyObject *py_uwsgi_cache_get(PyObject * self, PyObject * args) { } UWSGI_GET_GIL PyObject *ret = PyString_FromStringAndSize(NULL, valsize); +#ifdef PYTHREE + char *storage = PyBytes_AsString(ret); +#else char *storage = PyString_AS_STRING(ret); +#endif UWSGI_RELEASE_GIL #ifdef UWSGI_DEBUG gettimeofday(&tv2, NULL);