From a0ebd7b076fc359dd1f2f892aa8e70ee4ef4de2a Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 13 Jul 2009 15:40:07 +0200 Subject: python/generic.h: Use PyBytes_AS_STRING instead of PyBytes_AsString in PyUnicode_AsString. --- python/generic.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'python/generic.h') diff --git a/python/generic.h b/python/generic.h index 408529a5..639578c5 100644 --- a/python/generic.h +++ b/python/generic.h @@ -61,6 +61,7 @@ typedef int Py_ssize_t; // Compatibility for Python 2.5 and previous. #if (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 5) #define PyBytes_Check PyString_Check +#define PyBytes_AS_STRING PyString_AS_STRING #define PyBytes_AsString PyString_AsString #define PyBytes_AsStringAndSize PyString_AsStringAndSize #define PyVarObject_HEAD_INIT(type, size) PyObject_HEAD_INIT(type) size, @@ -78,7 +79,7 @@ static inline const char *PyUnicode_AsString(PyObject *op) { PyObject *bytes = PyUnicode_AsEncodedString(op,0,0); if (!bytes) return 0; - const char *result = PyBytes_AsString(bytes); + const char *result = PyBytes_AS_STRING(bytes); Py_DECREF(bytes); return result; } -- cgit v1.2.3