mirror of
https://github.com/python/cpython
synced 2026-09-29 09:25:29 +03:00
Issue #28927: bytes.fromhex() and bytearray.fromhex() now ignore all ASCII
whitespace, not only spaces. Patch by Robert Xiao.
This commit is contained in:
parent
f76df27806
commit
dd1da7f74a
5 changed files with 27 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue