summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/_zoneinfo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_zoneinfo.c b/Modules/_zoneinfo.c
index 12b3969..2cee65f 100644
--- a/Modules/_zoneinfo.c
+++ b/Modules/_zoneinfo.c
@@ -412,7 +412,6 @@ zoneinfo_clear_cache(PyObject *cls, PyObject *args, PyObject *kwargs)
}
clear_strong_cache(type);
- ZONEINFO_STRONG_CACHE = NULL;
}
else {
PyObject *item = NULL;
@@ -2471,6 +2470,7 @@ clear_strong_cache(const PyTypeObject *const type)
}
strong_cache_free(ZONEINFO_STRONG_CACHE);
+ ZONEINFO_STRONG_CACHE = NULL;
}
static PyObject *
@@ -2525,6 +2525,7 @@ zoneinfo_init_subclass(PyTypeObject *cls, PyObject *args, PyObject **kwargs)
}
PyObject_SetAttrString((PyObject *)cls, "_weak_cache", weak_cache);
+ Py_DECREF(weak_cache);
Py_RETURN_NONE;
}
@@ -2616,8 +2617,7 @@ module_free()
Py_CLEAR(ZONEINFO_WEAK_CACHE);
}
- strong_cache_free(ZONEINFO_STRONG_CACHE);
- ZONEINFO_STRONG_CACHE = NULL;
+ clear_strong_cache(&PyZoneInfo_ZoneInfoType);
}
static int