From dd1da7f74ad7d625148dc8a8f4f30051bc2c3401 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 19 Dec 2016 18:51:37 +0200 Subject: Issue #28927: bytes.fromhex() and bytearray.fromhex() now ignore all ASCII whitespace, not only spaces. Patch by Robert Xiao. --- Objects/bytesobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Objects/bytesobject.c') diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 0df90335ed..5bdfd62f96 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2378,10 +2378,10 @@ _PyBytes_FromHex(PyObject *string, int use_bytearray) end = str + hexlen; while (str < end) { /* skip over spaces in the input */ - if (*str == ' ') { + if (Py_ISSPACE(*str)) { do { str++; - } while (*str == ' '); + } while (Py_ISSPACE(*str)); if (str >= end) break; } -- cgit v1.2.1