Mercurial > vim
diff src/if_python.c @ 4589:fa39483a1363 v7.3.1042
updated for version 7.3.1042
Problem: Python: can't assign to vim.Buffer.name.
Solution: Python patch 3. (ZyX)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 29 May 2013 22:02:22 +0200 |
parents | b9f87487d935 |
children | 1e8952a5a726 |
line wrap: on
line diff
--- a/src/if_python.c +++ b/src/if_python.c @@ -676,18 +676,6 @@ get_exceptions(void) static int initialised = 0; #define PYINITIALISED initialised -#define DICTKEY_GET(err) \ - if (!PyString_Check(keyObject)) \ - { \ - PyErr_SetString(PyExc_TypeError, _("only string keys are allowed")); \ - return err; \ - } \ - if (PyString_AsStringAndSize(keyObject, (char **) &key, NULL) == -1) \ - return err; - -#define DICTKEY_UNREF -#define DICTKEY_DECL - #define DESTRUCTOR_FINISH(self) self->ob_type->tp_free((PyObject*)self); #define WIN_PYTHON_REF(win) win->w_python_ref @@ -926,7 +914,7 @@ DoPyCommand(const char *cmd, rangeinitia else { /* Need to make a copy, value may change when setting new locale. */ - saved_locale = (char *)vim_strsave((char_u *)saved_locale); + saved_locale = (char *) PY_STRSAVE(saved_locale); (void)setlocale(LC_NUMERIC, "C"); } #endif @@ -953,7 +941,7 @@ DoPyCommand(const char *cmd, rangeinitia if (saved_locale != NULL) { (void)setlocale(LC_NUMERIC, saved_locale); - vim_free(saved_locale); + PyMem_Free(saved_locale); } #endif