From 29b39d28ccafc818901adb5fda8d26406899d870 Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Tue, 27 Aug 2024 20:49:49 +0200 Subject: [PATCH] resolve merge issue --- Include/internal/pycore_object.h | 5 +---- Python/bltinmodule.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index 3b33516e0d71d3..2ef0aaee0f82b3 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -164,15 +164,12 @@ static inline void _Py_RefcntAdd(PyObject* op, Py_ssize_t n) static inline int _PyObject_IsUniquelyReferenced(PyObject *ob) { - /* Function to check whether an immutable object such as a tuple can be - * modified inplace by the owning method - */ #if !defined(Py_GIL_DISABLED) return Py_REFCNT(ob) == 1; #else // NOTE: the entire ob_ref_shared field must be zero, including flags, to // ensure that other threads cannot concurrently create new references to - // this object. + // this object. return (_Py_IsOwnedByCurrentThread(ob) && _Py_atomic_load_uint32_relaxed(&ob->ob_ref_local) == 1 && _Py_atomic_load_ssize_relaxed(&ob->ob_ref_shared) == 0); diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 96db33f3f70fcb..f87f942cc76258 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2972,7 +2972,7 @@ zip_next(zipobject *lz) if (tuplesize == 0) return NULL; - if (_Py_Reuse_Immutable_Object(result)) { + if (_PyObject_IsUniquelyReferenced(result)) { Py_INCREF(result); for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i);