diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-07-13 15:40:07 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-07-13 15:40:07 +0200 |
| commit | a0ebd7b076fc359dd1f2f892aa8e70ee4ef4de2a (patch) | |
| tree | b62c8c637dfc0adaad053ad0f35fa9c6aa44b097 /python/generic.h | |
| parent | f883d8f68487728946fd12bcfaa6a7e234288f4c (diff) | |
| download | python-apt-a0ebd7b076fc359dd1f2f892aa8e70ee4ef4de2a.tar.gz | |
python/generic.h: Use PyBytes_AS_STRING instead of PyBytes_AsString in PyUnicode_AsString.
Diffstat (limited to 'python/generic.h')
| -rw-r--r-- | python/generic.h | 3 |
1 files changed, 2 insertions, 1 deletions
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; } |
