diff options
author | Bram Moolenaar <Bram@vim.org> | 2011-06-26 04:01:44 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2011-06-26 04:01:44 +0200 |
commit | 91805fc0db6b957c5bf688f2d96585eae9179999 (patch) | |
tree | a2f1ffeb73f0e945e194e925393f76d83db62fc9 /src/if_py_both.h | |
parent | 6e948a652d6729a32d64d4247b94b754f2fc03bd (diff) | |
download | vim-git-91805fc0db6b957c5bf688f2d96585eae9179999.tar.gz |
updated for version 7.3.232v7.3.232
Problem: Python doesn't compile without +multi_byte
Solution: Use "latin1" when MULTI_BYTE is not defined.
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r-- | src/if_py_both.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h index 6cd1b23d3..07eedb5f3 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -12,6 +12,12 @@ * Common code for if_python.c and if_python3.c. */ +#ifdef FEAT_MBYTE +# define ENC_OPT p_enc +#else +# define ENC_OPT "latin1" +#endif + /* * obtain a lock on the Vim data structures */ @@ -68,7 +74,7 @@ OutputWrite(PyObject *self, PyObject *args) char *str = NULL; int error = ((OutputObject *)(self))->error; - if (!PyArg_ParseTuple(args, "es#", p_enc, &str, &len)) + if (!PyArg_ParseTuple(args, "es#", ENC_OPT, &str, &len)) return NULL; Py_BEGIN_ALLOW_THREADS @@ -108,7 +114,7 @@ OutputWritelines(PyObject *self, PyObject *args) char *str = NULL; PyInt len; - if (!PyArg_Parse(line, "es#", p_enc, &str, &len)) { + if (!PyArg_Parse(line, "es#", ENC_OPT, &str, &len)) { PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings")); Py_DECREF(list); return NULL; |