]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] bpo-41371: Handle lzma lib import error in test_zoneinfo.py (GH-21734) (GH...
authorKarthikeyan Singaravelan <tir.karthi@gmail.com>
Sat, 10 Oct 2020 04:39:09 +0000 (10:09 +0530)
committerGitHub <noreply@github.com>
Sat, 10 Oct 2020 04:39:09 +0000 (10:09 +0530)
(cherry picked from commit 5f0769a)

Co-authored-by: Nathan M <nathanmaynes@gmail.com>
Lib/test/test_zoneinfo/test_zoneinfo.py

index 85703269a1336e6005344d32c2fc58f0c9433771..d4704b75d389dfc92083a0d87630b9044f26c286 100644 (file)
@@ -6,7 +6,6 @@ import dataclasses
 import importlib.metadata
 import io
 import json
-import lzma
 import os
 import pathlib
 import pickle
@@ -20,7 +19,9 @@ from functools import cached_property
 
 from . import _support as test_support
 from ._support import OS_ENV_LOCK, TZPATH_TEST_LOCK, ZoneInfoTestBase
+from test.support import import_module
 
+lzma = import_module('lzma')
 py_zoneinfo, c_zoneinfo = test_support.get_modules()
 
 try: