summaryrefslogtreecommitdiff
path: root/src/if_python.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-11-20 10:04:53 +0000
committerBram Moolenaar <Bram@vim.org>2008-11-20 10:04:53 +0000
commit9774ecc80cd245a1c6b573633c6cccbd4e201bb9 (patch)
treeb7198e706094dced7e22c8deae148a65aa005d5e /src/if_python.c
parent0cd49305c48c5c9944a8420d0191c01964ab38cd (diff)
downloadvim-git-9774ecc80cd245a1c6b573633c6cccbd4e201bb9.tar.gz
updated for version 7.2-045v7.2.045
Diffstat (limited to 'src/if_python.c')
-rw-r--r--src/if_python.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/if_python.c b/src/if_python.c
index baf505c59..4a148840b 100644
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -531,6 +531,12 @@ Python_Init(void)
if (PythonMod_Init())
goto fail;
+ /* Remove the element from sys.path that was added because of our
+ * argv[0] value in PythonMod_Init(). Previously we used an empty
+ * string, but dependinding on the OS we then get an empty entry or
+ * the current directory in sys.path. */
+ PyRun_SimpleString("import sys; sys.path = filter(lambda x: x != '/must>not&exist', sys.path)");
+
/* the first python thread is vim's, release the lock */
Python_SaveThread();
@@ -2345,7 +2351,8 @@ PythonMod_Init(void)
{
PyObject *mod;
PyObject *dict;
- static char *(argv[2]) = {"", NULL};
+ /* The special value is removed from sys.path in Python_Init(). */
+ static char *(argv[2]) = {"/must>not&exist/foo", NULL};
/* Fixups... */
BufferType.ob_type = &PyType_Type;