Skip to content

Commit 6adafa1

Browse files
committed
Make tp_base stores atomic.
1 parent 9456147 commit 6adafa1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/_datetimemodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7331,8 +7331,8 @@ _PyDateTime_InitTypes(PyInterpreterState *interp)
73317331
// `&...` is not a constant expression according to a strict reading
73327332
// of C standards. Fill tp_base at run-time rather than statically.
73337333
// See https://bugs.python.org/issue40777
7334-
PyDateTime_TimeZoneType.tp_base = &PyDateTime_TZInfoType;
7335-
PyDateTime_DateTimeType.tp_base = &PyDateTime_DateType;
7334+
_Py_atomic_store_ptr_relaxed(&PyDateTime_TimeZoneType.tp_base, &PyDateTime_TZInfoType);
7335+
_Py_atomic_store_ptr_relaxed(&PyDateTime_DateTimeType.tp_base , &PyDateTime_DateType);
73367336

73377337
/* Bases classes must be initialized before subclasses,
73387338
* so capi_types must have the types in the appropriate order. */

0 commit comments

Comments
 (0)