]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.142 v7.3.142
authorBram Moolenaar <Bram@vim.org>
Tue, 22 Mar 2011 14:47:44 +0000 (15:47 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 22 Mar 2011 14:47:44 +0000 (15:47 +0100)
Problem:    Python stdout doesn't have a flush() method, causing an import to
            fail.
Solution:   Add a dummy flush() method. (Tobias Columbus)

src/if_py_both.h
src/version.c

index e435e3e5c09001ce4a4b456cd737cc6713f6a1e3..f78eccbd041ed1aa18557fed651f4c217c1bf60c 100644 (file)
@@ -33,6 +33,7 @@ Python_Release_Vim(void)
 
 static PyObject *OutputWrite(PyObject *, PyObject *);
 static PyObject *OutputWritelines(PyObject *, PyObject *);
+static PyObject *OutputFlush(PyObject *, PyObject *);
 
 /* Function to write a line, points to either msg() or emsg(). */
 typedef void (*writefn)(char_u *);
@@ -47,9 +48,10 @@ typedef struct
 
 static struct PyMethodDef OutputMethods[] = {
     /* name,       function,           calling,    documentation */
-    {"write",      OutputWrite,        1,          "" },
-    {"writelines",  OutputWritelines,  1,          "" },
-    { NULL,        NULL,               0,          NULL }
+    {"write",      OutputWrite,        1,          ""},
+    {"writelines",  OutputWritelines,  1,          ""},
+    {"flush",       OutputFlush,        1,          ""},
+    { NULL,        NULL,               0,          NULL}
 };
 
 #define PyErr_SetVim(str) PyErr_SetString(VimError, str)
@@ -123,6 +125,15 @@ OutputWritelines(PyObject *self, PyObject *args)
     return Py_None;
 }
 
+    static PyObject *
+OutputFlush(PyObject *self UNUSED, PyObject *args UNUSED)
+{
+    /* do nothing */
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
 /* Buffer IO, we write one whole line at a time. */
 static garray_T io_ga = {0, 0, 1, 80, NULL};
 static writefn old_fn = NULL;
index 3505097fb5554385a5d65666465fc120d6f1529b..6b266006ccfa3f59da266a4c1b44d0f0357ce977 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    142,
 /**/
     141,
 /**/