diff options
author | Benjamin Peterson <benjamin@python.org> | 2017-03-08 06:24:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-08 06:24:44 (GMT) |
commit | ad4a0cc519a5bb14204324e0e32e976318f9e6ce (patch) | |
tree | 2e07df2d2beaae9d84b48e5c9bf9a61de11009eb /Modules/_localemodule.c | |
parent | 02371e0ed1ee82ec73e7d363bcf2ed40cde1397a (diff) | |
download | cpython-ad4a0cc519a5bb14204324e0e32e976318f9e6ce.zip cpython-ad4a0cc519a5bb14204324e0e32e976318f9e6ce.tar.gz cpython-ad4a0cc519a5bb14204324e0e32e976318f9e6ce.tar.bz2 |
allow the first call to wcsxfrm to return ERANGE (#536)
If the output buffer provided to wcsxfrm is too small, errno is set to ERANGE. We should not error out in that case.
Diffstat (limited to 'Modules/_localemodule.c')
-rw-r--r-- | Modules/_localemodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index f5c126a..ecd673e 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -262,7 +262,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args) } errno = 0; n2 = wcsxfrm(buf, s, n1); - if (errno) { + if (errno && errno != ERANGE) { PyErr_SetFromErrno(PyExc_OSError); goto exit; } |