summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-05-29 22:26:18 +0200
committerBram Moolenaar <Bram@vim.org>2013-05-29 22:26:18 +0200
commit432b09c84dc6daf0b7ca8dac986bc0b1faf899d7 (patch)
treeee4cb3e820b87461d8c38087fc2ae30061b0c13b /src
parent21642ed1b4aeab32d419f310d2100999482b1079 (diff)
downloadvim-git-432b09c84dc6daf0b7ca8dac986bc0b1faf899d7.tar.gz
updated for version 7.3.1046v7.3.1046
Problem: Python: Using Py_BuildValue for building strings. Solution: Python patch 7 and 7.5: Replace Py_BuildValue with PyString_FromString. (ZyX)
Diffstat (limited to 'src')
-rw-r--r--src/if_py_both.h9
-rw-r--r--src/version.c2
2 files changed, 7 insertions, 4 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h
index ad6e97008..5b4574207 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -442,7 +442,7 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
if (our_tv->v_type == VAR_STRING)
{
- result = Py_BuildValue("s", our_tv->vval.v_string == NULL
+ result = PyString_FromString(our_tv->vval.v_string == NULL
? "" : (char *)our_tv->vval.v_string);
}
else if (our_tv->v_type == VAR_NUMBER)
@@ -451,7 +451,7 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
/* For backwards compatibility numbers are stored as strings. */
sprintf(buf, "%ld", (long)our_tv->vval.v_number);
- result = Py_BuildValue("s", buf);
+ result = PyString_FromString((char *) buf);
}
# ifdef FEAT_FLOAT
else if (our_tv->v_type == VAR_FLOAT)
@@ -459,7 +459,7 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
char buf[NUMBUFLEN];
sprintf(buf, "%f", our_tv->vval.v_float);
- result = Py_BuildValue("s", buf);
+ result = PyString_FromString((char *) buf);
}
# endif
else if (our_tv->v_type == VAR_LIST)
@@ -3256,7 +3256,8 @@ BufferAttrValid(BufferObject *self, char *name)
BufferAttr(BufferObject *self, char *name)
{
if (strcmp(name, "name") == 0)
- return Py_BuildValue("s", self->buf->b_ffname);
+ return PyString_FromString((self->buf->b_ffname == NULL
+ ? "" : (char *) self->buf->b_ffname));
else if (strcmp(name, "number") == 0)
return Py_BuildValue(Py_ssize_t_fmt, self->buf->b_fnum);
else if (strcmp(name, "vars") == 0)
diff --git a/src/version.c b/src/version.c
index 3afdf0177..aefc16609 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1046,
+/**/
1045,
/**/
1044,