gh-136421: Load `_datetime` static types during interpreter initialization (GH-136583)
`_datetime` is a special module, because it's the only non-builtin C extension that contains static types. As such, it would initialize static types in the module's execution function, which can run concurrently. Since static type initialization is not thread-safe, this caused crashes. This fixes it by moving the initialization of `_datetime`'s static types to interpreter startup (where all other static types are initialized), which is already properly protected through other locks.
P
Peter Bierma committed
a10960699a2b3e4e62896331c4f9cfd162ebf440
Parent: 80b2d60
Committed by GitHub <noreply@github.com>
on 7/21/2025, 5:47:26 PM