Karsten Hopp 556497
To: vim_dev@googlegroups.com
Karsten Hopp 556497
Subject: Patch 7.3.142
Karsten Hopp 556497
Fcc: outbox
Karsten Hopp 556497
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 556497
Mime-Version: 1.0
Karsten Hopp 556497
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 556497
Content-Transfer-Encoding: 8bit
Karsten Hopp 556497
------------
Karsten Hopp 556497
Karsten Hopp 556497
Patch 7.3.142
Karsten Hopp 556497
Problem:    Python stdout doesn't have a flush() method, causing an import to
Karsten Hopp 556497
	    fail.
Karsten Hopp 556497
Solution:   Add a dummy flush() method. (Tobias Columbus)
Karsten Hopp 556497
Files:	    src/if_py_both.h
Karsten Hopp 556497
Karsten Hopp 556497
Karsten Hopp 556497
*** ../vim-7.3.141/src/if_py_both.h	2010-10-27 12:17:54.000000000 +0200
Karsten Hopp 556497
--- src/if_py_both.h	2011-03-22 15:37:43.000000000 +0100
Karsten Hopp 556497
***************
Karsten Hopp 556497
*** 33,38 ****
Karsten Hopp 556497
--- 33,39 ----
Karsten Hopp 556497
  
Karsten Hopp 556497
  static PyObject *OutputWrite(PyObject *, PyObject *);
Karsten Hopp 556497
  static PyObject *OutputWritelines(PyObject *, PyObject *);
Karsten Hopp 556497
+ static PyObject *OutputFlush(PyObject *, PyObject *);
Karsten Hopp 556497
  
Karsten Hopp 556497
  /* Function to write a line, points to either msg() or emsg(). */
Karsten Hopp 556497
  typedef void (*writefn)(char_u *);
Karsten Hopp 556497
***************
Karsten Hopp 556497
*** 47,55 ****
Karsten Hopp 556497
  
Karsten Hopp 556497
  static struct PyMethodDef OutputMethods[] = {
Karsten Hopp 556497
      /* name,	    function,		calling,    documentation */
Karsten Hopp 556497
!     {"write",	    OutputWrite,	1,	    "" },
Karsten Hopp 556497
!     {"writelines",  OutputWritelines,	1,	    "" },
Karsten Hopp 556497
!     { NULL,	    NULL,		0,	    NULL }
Karsten Hopp 556497
  };
Karsten Hopp 556497
  
Karsten Hopp 556497
  #define PyErr_SetVim(str) PyErr_SetString(VimError, str)
Karsten Hopp 556497
--- 48,57 ----
Karsten Hopp 556497
  
Karsten Hopp 556497
  static struct PyMethodDef OutputMethods[] = {
Karsten Hopp 556497
      /* name,	    function,		calling,    documentation */
Karsten Hopp 556497
!     {"write",	    OutputWrite,	1,	    ""},
Karsten Hopp 556497
!     {"writelines",  OutputWritelines,	1,	    ""},
Karsten Hopp 556497
!     {"flush",       OutputFlush,        1,          ""},
Karsten Hopp 556497
!     { NULL,	    NULL,		0,	    NULL}
Karsten Hopp 556497
  };
Karsten Hopp 556497
  
Karsten Hopp 556497
  #define PyErr_SetVim(str) PyErr_SetString(VimError, str)
Karsten Hopp 556497
***************
Karsten Hopp 556497
*** 123,128 ****
Karsten Hopp 556497
--- 125,139 ----
Karsten Hopp 556497
      return Py_None;
Karsten Hopp 556497
  }
Karsten Hopp 556497
  
Karsten Hopp 556497
+     static PyObject *
Karsten Hopp 556497
+ OutputFlush(PyObject *self UNUSED, PyObject *args UNUSED)
Karsten Hopp 556497
+ {
Karsten Hopp 556497
+     /* do nothing */
Karsten Hopp 556497
+     Py_INCREF(Py_None);
Karsten Hopp 556497
+     return Py_None;
Karsten Hopp 556497
+ }
Karsten Hopp 556497
+ 
Karsten Hopp 556497
+ 
Karsten Hopp 556497
  /* Buffer IO, we write one whole line at a time. */
Karsten Hopp 556497
  static garray_T io_ga = {0, 0, 1, 80, NULL};
Karsten Hopp 556497
  static writefn old_fn = NULL;
Karsten Hopp 556497
*** ../vim-7.3.141/src/version.c	2011-03-22 14:35:01.000000000 +0100
Karsten Hopp 556497
--- src/version.c	2011-03-22 15:45:38.000000000 +0100
Karsten Hopp 556497
***************
Karsten Hopp 556497
*** 716,717 ****
Karsten Hopp 556497
--- 716,719 ----
Karsten Hopp 556497
  {   /* Add new patch number below this line */
Karsten Hopp 556497
+ /**/
Karsten Hopp 556497
+     142,
Karsten Hopp 556497
  /**/
Karsten Hopp 556497
Karsten Hopp 556497
-- 
Karsten Hopp 556497
Living on Earth includes an annual free trip around the Sun.
Karsten Hopp 556497
Karsten Hopp 556497
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 556497
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 556497
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 556497
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///