Skip to content

Commit 885505b

Browse files
Fix
1 parent 1fd497a commit 885505b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/test/test_zoneinfo/_support.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def get_modules():
3333
one time — in other words, when using this function you will only ever
3434
get one copy of each module rather than a fresh import each time.
3535
"""
36+
import zoneinfo as c_module
3637

3738
py_module = import_fresh_module("zoneinfo", blocked=["_zoneinfo"])
3839

Lib/test/test_zoneinfo/test_zoneinfo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,8 +1915,8 @@ def test_exclude_posixrules(self):
19151915
class CTestModule(TestModule):
19161916
module = c_zoneinfo
19171917

1918-
1919-
@unittest.skipIf(c_zoneinfo == py_zoneinfo,"zoneinfo C extension not available")
1918+
@unittest.skipIf(__import__("sys").modules.get("_zoneinfo") is None,
1919+
"_zoneinfo C module not available")
19201920
class ExtensionBuiltTest(unittest.TestCase):
19211921
"""Smoke test to ensure that the C and Python extensions are both tested.
19221922

0 commit comments

Comments
 (0)