From 95744bda2f16f290a8531fb693e3ca3c246a0ce5 Mon Sep 17 00:00:00 2001 From: Srinivas Reddy Thatiparthy Date: Mon, 9 Dec 2024 17:37:26 +0530 Subject: [PATCH] Revert the change that is not necessary --- Objects/bytesobject.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 983eae6677d9ae..879f9af32b4612 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2526,11 +2526,13 @@ _PyBytes_FromHex(PyObject *string, int use_bytearray) end = str + hexlen; while (str < end) { /* skip over spaces in the input */ - while (str < end && Py_ISSPACE(*str)) { - str++; + if (Py_ISSPACE(*str)) { + do { + str++; + } while (Py_ISSPACE(*str)); + if (str >= end) + break; } - if (str >= end) - break; /* Check first hex digit */ top = _PyLong_DigitValue[*str];