8000 gh-111881: Import lazily zipfile in support.script_helper by vstinner · Pull Request #112172 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111881: Import lazily zipfile in support.script_helper #112172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/test/support/script_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import os.path
import subprocess
import py_compile
import zipfile

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


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

def make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
source, depth=1, compiled=False):
import zipfile
unlink = []
init_name = make_script(zip_dir, '__init__', '')
unlink.append(init_name)
Expand Down
0