From 808c2bc8bf435917b792e172a22dc5f8c0e7066a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 23 Jun 2013 13:11:18 +0200 Subject: updated for version 7.3.1228 Problem: Python: various inconsistencies and problems. Solution: StringToLine now supports both bytes() and unicode() objects. Make function names consistant. Fix memory leak fixed in StringToLine. (ZyX) --- src/if_python3.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/if_python3.c') diff --git a/src/if_python3.c b/src/if_python3.c index d53d601fc0..9052e41597 100644 --- a/src/if_python3.c +++ b/src/if_python3.c @@ -84,13 +84,8 @@ #define PyInt Py_ssize_t #define PyString_Check(obj) PyUnicode_Check(obj) -#define PyString_AsBytes(obj) PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, CODEC_ERROR_HANDLER) -#define PyString_FreeBytes(obj) Py_XDECREF(bytes) -#define PyString_AsString(obj) PyBytes_AsString(obj) -#define PyString_Size(obj) PyBytes_GET_SIZE(bytes) #define PyString_FromString(repr) PyUnicode_FromString(repr) #define PyString_FromFormat PyUnicode_FromFormat -#define PyString_AsStringAndSize(obj, buffer, len) PyBytes_AsStringAndSize(obj, buffer, len) #define PyInt_Check(obj) PyLong_Check(obj) #define PyInt_FromLong(i) PyLong_FromLong(i) #define PyInt_AsLong(obj) PyLong_AsLong(obj) @@ -357,7 +352,7 @@ static char* (*py3__PyUnicode_AsString)(PyObject *unicode); # endif static PyObject* (*py3_PyUnicode_AsEncodedString)(PyObject *unicode, const char* encoding, const char* errors); static char* (*py3_PyBytes_AsString)(PyObject *bytes); -static int (*py3_PyBytes_AsStringAndSize)(PyObject *bytes, char **buffer, int *length); +static int (*py3_PyBytes_AsStringAndSize)(PyObject *bytes, char **buffer, Py_ssize_t *length); static PyObject* (*py3_PyBytes_FromString)(char *str); static PyObject* (*py3_PyFloat_FromDouble)(double num); static double (*py3_PyFloat_AsDouble)(PyObject *); -- cgit v1.2.3