SIGN IN SIGN UP

bpo-41568: Fix refleaks in zoneinfo subclasses (GH-21907)

* Fix refleak in C module __init_subclass__

This was leaking a reference to the weak cache dictionary for every
ZoneInfo subclass created.

* Fix refleak in ZoneInfo subclass's clear_cache

The previous version of the code accidentally cleared the global
ZONEINFO_STRONG_CACHE variable (and inducing `ZoneInfo` to create a new
strong cache) on calls to a subclass's `clear_cache()`. This would not
affect guaranteed behavior, but it's still not the right thing to do
(and it caused reference leaks).
P
Paul Ganssle committed
c3dd7e45cc5d36bbe2295c2840faabb5c75d83e4
Parent: 8aa163e
Committed by GitHub <noreply@github.com> on 8/17/2020, 10:40:07 PM