Skip to content

Commit 442f5ec

Browse files
[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 161012f) Co-authored-by: T. Wouters <[email protected]>
1 parent 56e3919 commit 442f5ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_gzip.py

Lines changed: 1 addition & 1 deletion
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)