lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
5a219a2
To: vim-dev@vim.org
5a219a2
Subject: Patch 7.2.045
5a219a2
Fcc: outbox
5a219a2
From: Bram Moolenaar <Bram@moolenaar.net>
5a219a2
Mime-Version: 1.0
5a219a2
Content-Type: text/plain; charset=ISO-8859-1
5a219a2
Content-Transfer-Encoding: 8bit
5a219a2
------------
5a219a2
5a219a2
Patch 7.2.045
5a219a2
Problem:    The Python interface has an empty entry in sys.path.
5a219a2
Solution:   Filter out the empty entry. (idea from James Vega)
5a219a2
Files:	    src/if_python.c
5a219a2
5a219a2
5a219a2
*** ../vim-7.2.044/src/if_python.c	Thu Jul 24 16:24:48 2008
5a219a2
--- src/if_python.c	Thu Nov 20 11:03:53 2008
5a219a2
***************
5a219a2
*** 531,536 ****
5a219a2
--- 531,542 ----
5a219a2
  	if (PythonMod_Init())
5a219a2
  	    goto fail;
5a219a2
  
5a219a2
+ 	/* Remove the element from sys.path that was added because of our
5a219a2
+ 	 * argv[0] value in PythonMod_Init().  Previously we used an empty
5a219a2
+ 	 * string, but dependinding on the OS we then get an empty entry or
5a219a2
+ 	 * the current directory in sys.path. */
5a219a2
+ 	PyRun_SimpleString("import sys; sys.path = filter(lambda x: x != '/must>not&exist', sys.path)");
5a219a2
+ 
5a219a2
  	/* the first python thread is vim's, release the lock */
5a219a2
  	Python_SaveThread();
5a219a2
  
5a219a2
***************
5a219a2
*** 2345,2351 ****
5a219a2
  {
5a219a2
      PyObject *mod;
5a219a2
      PyObject *dict;
5a219a2
!     static char *(argv[2]) = {"", NULL};
5a219a2
  
5a219a2
      /* Fixups... */
5a219a2
      BufferType.ob_type = &PyType_Type;
5a219a2
--- 2351,2358 ----
5a219a2
  {
5a219a2
      PyObject *mod;
5a219a2
      PyObject *dict;
5a219a2
!     /* The special value is removed from sys.path in Python_Init(). */
5a219a2
!     static char *(argv[2]) = {"/must>not&exist/foo", NULL};
5a219a2
  
5a219a2
      /* Fixups... */
5a219a2
      BufferType.ob_type = &PyType_Type;
5a219a2
*** ../vim-7.2.044/src/version.c	Thu Nov 20 10:36:04 2008
5a219a2
--- src/version.c	Thu Nov 20 10:58:11 2008
5a219a2
***************
5a219a2
*** 678,679 ****
5a219a2
--- 678,681 ----
5a219a2
  {   /* Add new patch number below this line */
5a219a2
+ /**/
5a219a2
+     45,
5a219a2
  /**/
5a219a2
5a219a2
-- 
5a219a2
press CTRL-ALT-DEL for more information
5a219a2
5a219a2
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
5a219a2
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
5a219a2
\\\        download, build and distribute -- http://www.A-A-P.org        ///
5a219a2
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///