Skip to content

Commit

Permalink
FIX: create_task
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Feb 20, 2024
1 parent f63f1d5 commit b09b3d8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ci_tools/nox_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,11 +715,15 @@ async def async_popen():
outlines = []
await asyncio.wait([
# process out is only redirected to STDOUT if not silent
_read_stream(process.stdout, lambda l: tee(l, sinklist=outlines, sinkstream=log_file_stream,
quiet=silent, verbosepipe=sys.stdout)),
asyncio.create_task(
_read_stream(process.stdout, lambda l: tee(l, sinklist=outlines, sinkstream=log_file_stream,
quiet=silent, verbosepipe=sys.stdout)),
),
# process err is always redirected to STDOUT (quiet=False) with a specific label
_read_stream(process.stderr, lambda l: tee(l, sinklist=outlines, sinkstream=log_file_stream,
quiet=False, verbosepipe=sys.stdout, label="ERR:"))
asyncio.create_task(
_read_stream(process.stderr, lambda l: tee(l, sinklist=outlines, sinkstream=log_file_stream,
quiet=False, verbosepipe=sys.stdout, label="ERR:"))
),
])
return_code = await process.wait() # make sur the process has ended and retrieve its return code
return return_code, outlines
Expand Down

0 comments on commit b09b3d8

Please sign in to comment.