1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Python stdout doesn't have a flush() method, causing an import to
13 Solution: Add a dummy flush() method. (Tobias Columbus)
14 Files: src/if_py_both.h
17 *** ../vim-7.3.141/src/if_py_both.h 2010-10-27 12:17:54.000000000 +0200
18 --- src/if_py_both.h 2011-03-22 15:37:43.000000000 +0100
23 static PyObject *OutputWrite(PyObject *, PyObject *);
24 static PyObject *OutputWritelines(PyObject *, PyObject *);
25 + static PyObject *OutputFlush(PyObject *, PyObject *);
27 /* Function to write a line, points to either msg() or emsg(). */
28 typedef void (*writefn)(char_u *);
32 static struct PyMethodDef OutputMethods[] = {
33 /* name, function, calling, documentation */
34 ! {"write", OutputWrite, 1, "" },
35 ! {"writelines", OutputWritelines, 1, "" },
36 ! { NULL, NULL, 0, NULL }
39 #define PyErr_SetVim(str) PyErr_SetString(VimError, str)
42 static struct PyMethodDef OutputMethods[] = {
43 /* name, function, calling, documentation */
44 ! {"write", OutputWrite, 1, ""},
45 ! {"writelines", OutputWritelines, 1, ""},
46 ! {"flush", OutputFlush, 1, ""},
47 ! { NULL, NULL, 0, NULL}
50 #define PyErr_SetVim(str) PyErr_SetString(VimError, str)
58 + OutputFlush(PyObject *self UNUSED, PyObject *args UNUSED)
66 /* Buffer IO, we write one whole line at a time. */
67 static garray_T io_ga = {0, 0, 1, 80, NULL};
68 static writefn old_fn = NULL;
69 *** ../vim-7.3.141/src/version.c 2011-03-22 14:35:01.000000000 +0100
70 --- src/version.c 2011-03-22 15:45:38.000000000 +0100
74 { /* Add new patch number below this line */
80 Living on Earth includes an annual free trip around the Sun.
82 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
83 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
84 \\\ an exciting new programming language -- http://www.Zimbu.org ///
85 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///