cpython
cpython copied to clipboard
gh-142781: Fix type confusion in zoneinfo weak cache
Validate the types returned from _weak_cache.get() and _weak_cache.setdefault() to prevent type confusion when a ZoneInfo subclass provides a misbehaving cache implementation.
Fixes gh-142781.