[Python-checkins] bpo-41371: Handle lzma lib import error in test_zoneinfo.py (GH-21734)

Nathan M webhook-mailer at python.org
Thu Aug 6 18:09:56 EDT 2020


https://github.com/python/cpython/commit/5f0769a7529fcbc28190864f098f192053a10747
commit: 5f0769a7529fcbc28190864f098f192053a10747
branch: master
author: Nathan M <nathanmaynes at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-08-06T15:09:40-07:00
summary:

bpo-41371: Handle lzma lib import error in test_zoneinfo.py (GH-21734)

files:
M Lib/test/test_zoneinfo/test_zoneinfo.py

diff --git a/Lib/test/test_zoneinfo/test_zoneinfo.py b/Lib/test/test_zoneinfo/test_zoneinfo.py
index 1f1fa60f1ffc1..d16e0d2c33106 100644
--- a/Lib/test/test_zoneinfo/test_zoneinfo.py
+++ b/Lib/test/test_zoneinfo/test_zoneinfo.py
@@ -6,7 +6,6 @@
 import importlib.metadata
 import io
 import json
-import lzma
 import os
 import pathlib
 import pickle
@@ -20,7 +19,9 @@
 
 from . import _support as test_support
 from ._support import OS_ENV_LOCK, TZPATH_TEST_LOCK, ZoneInfoTestBase
+from test.support.import_helper import import_module
 
+lzma = import_module('lzma')
 py_zoneinfo, c_zoneinfo = test_support.get_modules()
 
 try:



More information about the Python-checkins mailing list