From 5fd952efc4fb83e0a3d2bae7c788237f86842ee7 Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Thu, 19 Dec 2024 07:41:51 +0000 Subject: [PATCH] fix _PyUnicode_CheckConsistency --- Objects/unicodeobject.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 0def2aedabbeb8..1aab9cf37768a8 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -707,9 +707,10 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content) CHECK(_PyUnicode_UTF8(op) != data); } } - +#ifndef Py_GIL_DISABLED if (_PyUnicode_UTF8(op) == NULL) CHECK(compact->utf8_length == 0); +#endif } /* check that the best kind is used: O(n) operation */