From 442f5ec042a2d18eaaa49346d9c86bba6389958d Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Wed, 28 Jun 2023 03:46:16 -0700 Subject: [3.12] GH-106160: Fix test_gzip failing under WASI, which does not have zlib. (GH-106167) (#106170) GH-106160: Fix test_gzip failing under WASI, which does not have zlib. (GH-106167) Fix test_gzip's failure under WASI, which does not have zlib, by using test.support.import_helper.import_module to import zlib. (gzip unconditionally imports zlib, so this does not cause any new skips.) (cherry picked from commit 161012fc25910a47423bae8012398bf519a88140) Co-authored-by: T. Wouters --- Lib/test/test_gzip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index c7ac7c6..b06b3b0 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -9,7 +9,6 @@ import pathlib import struct import sys import unittest -import zlib from subprocess import PIPE, Popen from test.support import import_helper from test.support import os_helper @@ -17,6 +16,7 @@ from test.support import _4G, bigmemtest, requires_subprocess from test.support.script_helper import assert_python_ok, assert_python_failure gzip = import_helper.import_module('gzip') +zlib = import_helper.import_module('zlib') data1 = b""" int length=DEFAULTALLOC, err = Z_OK; PyObject *RetVal; -- cgit v0.12