Skip to content

Commit cc740a2

Browse files
committed
Fix docker exec typing
Resolve a latent typing issue introduced in caba607 where the integration test helper assumed docker exec always returned bytes. Handle both bytes and streamed output explicitly without changing test behavior.
1 parent 3b2b287 commit cc740a2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/integration/test_manylinux.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,15 @@ def docker_exec(
358358
env = env.copy() if env is not None else {}
359359
env["COVERAGE_PROCESS_START"] = "/auditwheel_src/pyproject.toml"
360360
ec, output = container.exec_run(cmd, workdir=cwd, environment=env)
361-
output = output.decode("utf-8")
361+
assert isinstance(ec, int)
362+
if isinstance(output, bytes):
363+
output_text = output.decode("utf-8")
364+
else:
365+
output_text = b"".join(output).decode("utf-8")
362366
if ec != expected_retcode:
363-
logger.info("docker exec error %s: %s", container.id[:12], output)
364-
raise CalledProcessError(ec, cmd, output=output)
365-
return output
367+
logger.info("docker exec error %s: %s", container.id[:12], output_text)
368+
raise CalledProcessError(ec, cmd, output=output_text)
369+
return output_text
366370

367371

368372
@contextmanager

0 commit comments

Comments
 (0)