diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-12-21 18:18:28 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-12-21 18:18:28 +0100 |
| commit | 4861eac4753a9b60ed6df2d25aae0da74b84728a (patch) | |
| tree | eb468082ea40517bb34f995be228368f4013758a /python | |
| parent | 0e40b52a82efc95161c2dfb84f3c3737452336fb (diff) | |
| parent | 674f6c2e21b8f59a6a23089eb8da5f210f865bc2 (diff) | |
| download | python-apt-4861eac4753a9b60ed6df2d25aae0da74b84728a.tar.gz | |
merged from debian-sid
Diffstat (limited to 'python')
| -rw-r--r-- | python/generic.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python/generic.h b/python/generic.h index 7abf7e7a..ce9e5091 100644 --- a/python/generic.h +++ b/python/generic.h @@ -79,7 +79,9 @@ typedef int Py_ssize_t; static inline const char *PyUnicode_AsString(PyObject *op) { // Convert to bytes object, using the default encoding. - PyObject *bytes = PyUnicode_AsEncodedString(op,0,0); + // Use Python-internal API, there is no other way to do this + // without a memory leak. + PyObject *bytes = _PyUnicode_AsDefaultEncodedString(op, 0); return bytes ? PyBytes_AS_STRING(bytes) : 0; } |
