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

Karthikeyan Singaravelan webhook-mailer at python.org
Sat Oct 10 00:39:13 EDT 2020


https://github.com/python/cpython/commit/20bdeedfb4ebd250dad9834c96cb858d83c896cb
commit: 20bdeedfb4ebd250dad9834c96cb858d83c896cb
branch: 3.9
author: Karthikeyan Singaravelan <tir.karthi at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-10-10T10:09:09+05:30
summary:

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

(cherry picked from commit 5f0769a)

Co-authored-by: Nathan M <nathanmaynes at gmail.com>

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 85703269a1336..d4704b75d389d 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 import_module
 
+lzma = import_module('lzma')
 py_zoneinfo, c_zoneinfo = test_support.get_modules()
 
 try:



More information about the Python-checkins mailing list