Skip to content

Commit 7227e3e

Browse files
committed
Address the review
1 parent 3d0d584 commit 7227e3e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Objects/object.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,16 +1715,14 @@ _PyObject_GenericGetAttrWithDict(PyObject *obj, PyObject *name,
17151715
dict = (PyObject *)_PyObject_GetManagedDict(obj);
17161716
}
17171717
else {
1718-
Py_BEGIN_CRITICAL_SECTION(obj);
1719-
#ifdef DISABLE_GIL
1720-
PyObject **dictptr = _Py_atomic_load_ptr(_PyObject_ComputedDictPointer(obj));
1721-
#else
17221718
PyObject **dictptr = _PyObject_ComputedDictPointer(obj);
1723-
#endif
17241719
if (dictptr) {
1720+
#ifdef Py_GIL_DISABLED
1721+
dict = _Py_atomic_load_ptr_acquire(dictptr);
1722+
#else
17251723
dict = *dictptr;
1724+
#endif
17261725
}
1727-
Py_END_CRITICAL_SECTION();
17281726
}
17291727
}
17301728
if (dict != NULL) {

0 commit comments

Comments
 (0)