summaryrefslogtreecommitdiffstats
path: root/src/if_python3.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-23 13:11:18 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-23 13:11:18 +0200
commit808c2bc8bf435917b792e172a22dc5f8c0e7066a (patch)
tree84a7b5846ce850af47f3bf8358818d46470e97d4 /src/if_python3.c
parent389a1793f40b149ed8553fb75e7ee40bc684d8c5 (diff)
updated for version 7.3.1228v7.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)
Diffstat (limited to 'src/if_python3.c')
-rw-r--r--src/if_python3.c7
1 files changed, 1 insertions, 6 deletions
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 *);