Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f66afa3

Browse filesBrowse files
authored
gh-111881: Import lazily zipfile in support.script_helper (#112172)
It allows running the test suite when the zlib extension is missing.
1 parent 7680da4 commit f66afa3
Copy full SHA for f66afa3

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎Lib/test/support/script_helper.py

Copy file name to clipboardExpand all lines: Lib/test/support/script_helper.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import os.path
99
import subprocess
1010
import py_compile
11-
import zipfile
1211

1312
from importlib.util import source_from_cache
1413
from test import support
@@ -226,6 +225,7 @@ def make_script(script_dir, script_basename, source, omit_suffix=False):
226225

227226

228227
def make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None):
228+
import zipfile
229229
zip_filename = zip_basename+os.extsep+'zip'
230230
zip_name = os.path.join(zip_dir, zip_filename)
231231
with zipfile.ZipFile(zip_name, 'w') as zip_file:
@@ -252,6 +252,7 @@ def make_pkg(pkg_dir, init_source=''):
252252

253253
def make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
254254
source, depth=1, compiled=False):
255+
import zipfile
255256
unlink = []
256257
init_name = make_script(zip_dir, '__init__', '')
257258
unlink.append(init_name)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.