mirror of https://github.com/pypa/pip
Update src/pip/_internal/build_env.py
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
This commit is contained in:
parent
beeb89c294
commit
346edd64bc
|
@ -58,7 +58,10 @@ def _create_standalone_pip() -> Iterator[str]:
|
|||
|
||||
with TempDirectory(kind="standalone-pip") as tmp_dir:
|
||||
pip_zip = os.path.join(tmp_dir.path, "__env_pip__.zip")
|
||||
with zipfile.ZipFile(pip_zip, "w", strict_timestamps=False) as zf:
|
||||
kwargs = {}
|
||||
if sys.version_info >= (3, 8):
|
||||
kwargs["strict_timestamps"] = False
|
||||
with zipfile.ZipFile(pip_zip, "w", **kwargs) as zf:
|
||||
for child in source.rglob("*"):
|
||||
zf.write(child, child.relative_to(source.parent).as_posix())
|
||||
yield os.path.join(pip_zip, "pip")
|
||||
|
|
Loading…
Reference in New Issue