diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-06-01 20:38:34 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-06-01 20:38:34 +0200 |
commit | 22081f4a3397704645841121d994058abd6cb481 (patch) | |
tree | 1389d9b8dd7ae7473720d2aa05857dfcecdbd0f2 /src/if_py_both.h | |
parent | 9b0ac229bcfc91acabd35fc576055a94c1687c32 (diff) | |
download | vim-git-22081f4a3397704645841121d994058abd6cb481.tar.gz |
patch 7.4.1864v7.4.1864
Problem: Python: encoding error with Python 2.
Solution: Use "getcwdu" instead of "getcwd". (Ken Takata)
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r-- | src/if_py_both.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h index ce8bacd85..50fd687d9 100644 --- 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"))) |