astepano / rpms / vim

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