Skip to content

Commit 161012f

Browse files
authored
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.)
1 parent 84caa33 commit 161012f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_gzip.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
import struct
1010
import sys
1111
import unittest
12-
import zlib
1312
from subprocess import PIPE, Popen
1413
from test.support import import_helper
1514
from test.support import os_helper
1615
from test.support import _4G, bigmemtest, requires_subprocess
1716
from test.support.script_helper import assert_python_ok, assert_python_failure
1817

1918
gzip = import_helper.import_module('gzip')
19+
zlib = import_helper.import_module('zlib')
2020

2121
data1 = b""" int length=DEFAULTALLOC, err = Z_OK;
2222
PyObject *RetVal;

0 commit comments

Comments
 (0)