From c7d967d43c2c596382e1dbcfa2e7dc594b655d0f Mon Sep 17 00:00:00 2001 From: "roberto@precise64" Date: Thu, 1 Mar 2012 18:30:32 +0100 Subject: [PATCH] fixed python 3 --- plugins/python/uwsgi_pymodule.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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);