Skip to content

Commit

Permalink
pythonGH-106160: Fix test_gzip failing under WASI, which does not hav…
Browse files Browse the repository at this point in the history
…e zlib. (python#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.)
  • Loading branch information
Yhg1s committed Jun 28, 2023
1 parent 84caa33 commit 161012f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/test_gzip.py
Expand Up @@ -9,14 +9,14 @@
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
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;
Expand Down

0 comments on commit 161012f

Please sign in to comment.