Mercurial > vim
changeset 2735:322a5c8d392b v7.3.144
updated for version 7.3.144
Problem: Crash with ":python help(dir)". (Kearn Holliday)
Solution: Fix the way the type is set on objects. (Tobias Columbus)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 26 Mar 2011 13:56:48 +0100 |
parents | 719ff65f993e |
children | 51bf5624dde3 |
files | src/if_python.c src/version.c |
diffstat | 2 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/if_python.c +++ b/src/if_python.c @@ -780,7 +780,7 @@ OutputSetattr(PyObject *self, char *name PythonIO_Init(void) { /* Fixups... */ - OutputType.ob_type = &PyType_Type; + PyType_Ready(&OutputType); return PythonIO_Init_io(); } @@ -1402,12 +1402,12 @@ PythonMod_Init(void) static char *(argv[2]) = {"/must>not&exist/foo", NULL}; /* Fixups... */ - BufferType.ob_type = &PyType_Type; - RangeType.ob_type = &PyType_Type; - WindowType.ob_type = &PyType_Type; - BufListType.ob_type = &PyType_Type; - WinListType.ob_type = &PyType_Type; - CurrentType.ob_type = &PyType_Type; + PyType_Ready(&BufferType); + PyType_Ready(&RangeType); + PyType_Ready(&WindowType); + PyType_Ready(&BufListType); + PyType_Ready(&WinListType); + PyType_Ready(&CurrentType); /* Set sys.argv[] to avoid a crash in warn(). */ PySys_SetArgv(1, argv);