summaryrefslogtreecommitdiffstats
path: root/vi/vim-7.2/7.2.045
blob: cf37908d2aebbadb78144ab5f85c26204dc5ea0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
To: vim-dev@vim.org
Subject: Patch 7.2.045
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.045
Problem:    The Python interface has an empty entry in sys.path.
Solution:   Filter out the empty entry. (idea from James Vega)
Files:	    src/if_python.c


*** ../vim-7.2.044/src/if_python.c	Thu Jul 24 16:24:48 2008
--- src/if_python.c	Thu Nov 20 11:03:53 2008
***************
*** 531,536 ****
--- 531,542 ----
  	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,2351 ****
  {
      PyObject *mod;
      PyObject *dict;
!     static char *(argv[2]) = {"", NULL};
  
      /* Fixups... */
      BufferType.ob_type = &PyType_Type;
--- 2351,2358 ----
  {
      PyObject *mod;
      PyObject *dict;
!     /* 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;
*** ../vim-7.2.044/src/version.c	Thu Nov 20 10:36:04 2008
--- src/version.c	Thu Nov 20 10:58:11 2008
***************
*** 678,679 ****
--- 678,681 ----
  {   /* Add new patch number below this line */
+ /**/
+     45,
  /**/

-- 
press CTRL-ALT-DEL for more information

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///