From 22081f4a3397704645841121d994058abd6cb481 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 1 Jun 2016 20:38:34 +0200 Subject: patch 7.4.1864 Problem: Python: encoding error with Python 2. Solution: Use "getcwdu" instead of "getcwd". (Ken Takata) --- src/if_py_both.h | 5 +++++ src/version.c | 2 ++ 2 files changed, 7 insertions(+) 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"))) diff --git a/src/version.c b/src/version.c index 0d234a5d3..a934fe72e 100644 --- a/src/version.c +++ b/src/version.c @@ -753,6 +753,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1864, /**/ 1863, /**/ -- cgit v1.2.1