GH-106160: Fix test_gzip failing under WASI, which does not have zlib. (#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.)
This commit is contained in:
T. Wouters 2023-06-28 02:55:11 +02:00 committed by GitHub
parent 84caa3324a
commit 161012fc25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,6 @@
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.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;