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