summaryrefslogtreecommitdiff
path: root/src/if_python3.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-12 22:47:31 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-12 22:47:31 +0100
commit6e5ea8d2a995b32bbc5972edc4f827b959f2702f (patch)
treeb1ad7d6a83f53220227122719d5eb97dd32ff1e6 /src/if_python3.c
parente3c74d249ac36404d8af25f74baf335d143b30e3 (diff)
downloadvim-git-6e5ea8d2a995b32bbc5972edc4f827b959f2702f.tar.gz
patch 8.1.0735: cannot handle binary datav8.1.0735
Problem: Cannot handle binary data. Solution: Add the Blob type. (Yasuhiro Matsumoto, closes #3638)
Diffstat (limited to 'src/if_python3.c')
-rw-r--r--src/if_python3.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/if_python3.c b/src/if_python3.c
index 75d212274..a41d6acff 100644
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -232,6 +232,8 @@ typedef PySliceObject PySliceObject_T;
# endif
# undef PyBytes_FromString
# define PyBytes_FromString py3_PyBytes_FromString
+# undef PyBytes_FromStringAndSize
+# define PyBytes_FromStringAndSize py3_PyBytes_FromStringAndSize
# define PyFloat_FromDouble py3_PyFloat_FromDouble
# define PyFloat_AsDouble py3_PyFloat_AsDouble
# define PyObject_GenericGetAttr py3_PyObject_GenericGetAttr
@@ -394,6 +396,7 @@ static PyObject* (*py3_PyUnicode_AsEncodedString)(PyObject *unicode, const char*
static char* (*py3_PyBytes_AsString)(PyObject *bytes);
static int (*py3_PyBytes_AsStringAndSize)(PyObject *bytes, char **buffer, Py_ssize_t *length);
static PyObject* (*py3_PyBytes_FromString)(char *str);
+static PyObject* (*py3_PyBytes_FromStringAndSize)(char *str, Py_ssize_t length);
static PyObject* (*py3_PyFloat_FromDouble)(double num);
static double (*py3_PyFloat_AsDouble)(PyObject *);
static PyObject* (*py3_PyObject_GenericGetAttr)(PyObject *obj, PyObject *name);
@@ -559,6 +562,7 @@ static struct
{"PyBytes_AsString", (PYTHON_PROC*)&py3_PyBytes_AsString},
{"PyBytes_AsStringAndSize", (PYTHON_PROC*)&py3_PyBytes_AsStringAndSize},
{"PyBytes_FromString", (PYTHON_PROC*)&py3_PyBytes_FromString},
+ {"PyBytes_FromStringAndSize", (PYTHON_PROC*)&py3_PyBytes_FromStringAndSize},
{"PyFloat_FromDouble", (PYTHON_PROC*)&py3_PyFloat_FromDouble},
{"PyFloat_AsDouble", (PYTHON_PROC*)&py3_PyFloat_AsDouble},
{"PyObject_GenericGetAttr", (PYTHON_PROC*)&py3_PyObject_GenericGetAttr},
@@ -1680,6 +1684,7 @@ do_py3eval (char_u *str, typval_T *rettv)
case VAR_SPECIAL:
case VAR_JOB:
case VAR_CHANNEL:
+ case VAR_BLOB:
break;
}
}