4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Python bails out when giving a warning message. (Eugene
13 Solution: Set sys.argv[] to an empty string.
14 Files: src/if_python.c
17 *** ../vim-6.2.153/src/if_python.c Tue Sep 9 22:38:27 2003
18 --- src/if_python.c Wed Nov 12 10:00:44 2003
22 # define PyString_Size dll_PyString_Size
23 # define PyString_Type (*dll_PyString_Type)
24 # define PySys_SetObject dll_PySys_SetObject
25 + # define PySys_SetArgv dll_PySys_SetArgv
26 # define PyType_Type (*dll_PyType_Type)
27 # define Py_BuildValue dll_Py_BuildValue
28 # define Py_FindMethod dll_Py_FindMethod
32 static int(*dll_PyString_Size)(PyObject *);
33 static PyTypeObject* dll_PyString_Type;
34 static int(*dll_PySys_SetObject)(char *, PyObject *);
35 + static int(*dll_PySys_SetArgv)(int, char **);
36 static PyTypeObject* dll_PyType_Type;
37 static PyObject*(*dll_Py_BuildValue)(char *, ...);
38 static PyObject*(*dll_Py_FindMethod)(struct PyMethodDef[], PyObject *, char *);
42 {"PyString_Size", (PYTHON_PROC*)&dll_PyString_Size},
43 {"PyString_Type", (PYTHON_PROC*)&dll_PyString_Type},
44 {"PySys_SetObject", (PYTHON_PROC*)&dll_PySys_SetObject},
45 + {"PySys_SetArgv", (PYTHON_PROC*)&dll_PySys_SetArgv},
46 {"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type},
47 {"Py_BuildValue", (PYTHON_PROC*)&dll_Py_BuildValue},
48 {"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod},
55 + static char *(argv[2]) = {"", NULL};
58 BufferType.ob_type = &PyType_Type;
62 BufListType.ob_type = &PyType_Type;
63 WinListType.ob_type = &PyType_Type;
64 CurrentType.ob_type = &PyType_Type;
66 + /* Set sys.argv[] to avoid a crash in warn(). */
67 + PySys_SetArgv(1, argv);
69 mod = Py_InitModule("vim", VimMethods);
70 dict = PyModule_GetDict(mod);
71 *** ../vim-6.2.153/src/version.c Wed Nov 12 20:50:01 2003
72 --- src/version.c Wed Nov 12 20:51:18 2003
76 { /* Add new patch number below this line */
82 hundred-and-one symptoms of being an internet addict:
83 9. All your daydreaming is preoccupied with getting a faster connection to the
84 net: 28.8...ISDN...cable modem...T1...T3.
86 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
87 /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
88 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
89 \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///