From d9eda705beddb79d3957da400cd8fb7dfc37ee5f Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Thu, 11 Jun 2026 19:59:49 +0100 Subject: [PATCH] debug tzinfo subclass finalization crash --- pytests/tests/test_datetime.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pytests/tests/test_datetime.py b/pytests/tests/test_datetime.py index e0d77f87b03..ca5e32dd38c 100644 --- a/pytests/tests/test_datetime.py +++ b/pytests/tests/test_datetime.py @@ -328,3 +328,12 @@ def test_tz_class_introspection(): assert tzi.__class__ == rdt.TzClass # PyPy generates for some reason. assert re.match(r"^<[\w\.]*TzClass object at", repr(tzi)) + + +def test_tz_class_finalization(): + # Regression test for https://github.com/PyO3/pyo3/issues/6110 + + global TzClassHolder + + class TzClassHolder: + instance = rdt.TzClass()