diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-19 16:51:37 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-19 16:51:37 (GMT) |
commit | dd1da7f74ad7d625148dc8a8f4f30051bc2c3401 (patch) | |
tree | afe9fa4899ecb9838fddfba858bea5ecb4253dbd /Objects/bytesobject.c | |
parent | f76df278068252fe7637caeb2d7166f761f124fb (diff) | |
download | cpython-dd1da7f74ad7d625148dc8a8f4f30051bc2c3401.zip cpython-dd1da7f74ad7d625148dc8a8f4f30051bc2c3401.tar.gz cpython-dd1da7f74ad7d625148dc8a8f4f30051bc2c3401.tar.bz2 |
Issue #28927: bytes.fromhex() and bytearray.fromhex() now ignore all ASCII
whitespace, not only spaces. Patch by Robert Xiao.
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r-- | Objects/bytesobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 0df9033..5bdfd62 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; } |