From f3091587ee1e068a13a5ce88d40040a7c4efe923 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Fri, 23 Oct 2026 20:11:27 +0100 Subject: [PATCH] gh-120965: Skip `test_zoneinfo.ExtensionBuiltTest` if C extension is not available (GH-131104) (cherry picked from commit 897671bfd52767e9941640ec01f6cb68c6342d9b) Co-authored-by: Stan Ulbrych Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com> --- Lib/test/test_zoneinfo/test_zoneinfo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_zoneinfo/test_zoneinfo.py b/Lib/test/test_zoneinfo/test_zoneinfo.py index 40696b09d95719..8513268b0d56b6 100644 --- a/Lib/test/test_zoneinfo/test_zoneinfo.py +++ b/Lib/test/test_zoneinfo/test_zoneinfo.py @@ -12,6 +12,7 @@ import re import shutil import struct +import sys import tempfile import unittest from datetime import date, datetime, time, timedelta, timezone @@ -2201,6 +2202,8 @@ def test_pydatetime(self): PYTHONTZPATH=str(ZONEINFO_DATA.tzpath)) +@unittest.skipIf(sys.modules.get("_zoneinfo") is None, + "_zoneinfo C module not available") class ExtensionBuiltTest(unittest.TestCase): """Smoke test to ensure that the C and Python extensions are both tested.