Skip to content

Commit

Permalink
Fix a Pylint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Darandos committed May 26, 2022
1 parent 9ab89f9 commit 5d439c0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cibuildwheel/docker_container.py
Expand Up @@ -128,7 +128,7 @@ def copy_into(self, from_path: Path, to_path: PurePath) -> None:
cwd=from_path,
)
else:
docker = subprocess.Popen(
with subprocess.Popen(
[
"docker",
"exec",
Expand All @@ -139,17 +139,17 @@ def copy_into(self, from_path: Path, to_path: PurePath) -> None:
f"cat > {shell_quote(to_path)}",
],
stdin=subprocess.PIPE,
)
docker.stdin = cast(IO[bytes], docker.stdin)
) as docker:
docker.stdin = cast(IO[bytes], docker.stdin)

with open(from_path, "rb") as from_file:
shutil.copyfileobj(from_file, docker.stdin)
with open(from_path, "rb") as from_file:
shutil.copyfileobj(from_file, docker.stdin)

docker.stdin.close()
docker.wait()
docker.stdin.close()
docker.wait()

if docker.returncode:
raise subprocess.CalledProcessError(docker.returncode, docker.args, None, None)
if docker.returncode:
raise subprocess.CalledProcessError(docker.returncode, docker.args, None, None)

def copy_out(self, from_path: PurePath, to_path: Path) -> None:
# note: we assume from_path is a dir
Expand Down

0 comments on commit 5d439c0

Please sign in to comment.