[3.13] gh-125243: Fix ZoneInfo data race in free threading build (GH-125281) (gh-125414)
Lock `ZoneInfoType` to protect accesses to `ZONEINFO_STRONG_CACHE`. Refactor the `tp_new` handler to use Argument Clinic so that we can just use `@critical_section` annotations on the relevant functions. Also use `PyDict_SetDefaultRef` instead of `PyDict_SetDefault` when inserting into the `TIMEDELTA_CACHE`. (cherry picked from commit f1d33dbddd3496b062e1fbe024fb6d7b023a35f5) Co-authored-by: Sam Gross <colesbury@gmail.com>
M
Miss Islington (bot) committed
6474e296c04f136c9d664c899d126795f280ff11
Parent: 2ded598
Committed by GitHub <noreply@github.com>
on 10/15/2024, 9:02:32 PM