Mercurial > vim
changeset 9161:56c93626f6f3 v7.4.1864
commit https://github.com/vim/vim/commit/22081f4a3397704645841121d994058abd6cb481
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jun 1 20:38:34 2016 +0200
patch 7.4.1864
Problem: Python: encoding error with Python 2.
Solution: Use "getcwdu" instead of "getcwd". (Ken Takata)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 01 Jun 2016 20:45:08 +0200 |
parents | fe98d14cae8b |
children | 9652f2e50ea1 |
files | src/if_py_both.h src/version.c |
diffstat | 2 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -6770,8 +6770,13 @@ populate_module(PyObject *m) return -1; ADD_OBJECT(m, "os", other_module); +#if PY_MAJOR_VERSION >= 3 if (!(py_getcwd = PyObject_GetAttrString(other_module, "getcwd"))) return -1; +#else + if (!(py_getcwd = PyObject_GetAttrString(other_module, "getcwdu"))) + return -1; +#endif ADD_OBJECT(m, "_getcwd", py_getcwd) if (!(py_chdir = PyObject_GetAttrString(other_module, "chdir")))