Loading behave_utils/proc.py +11 −8 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ from __future__ import annotations import io import sys from copy import copy from functools import partial from os import PathLike from os import fspath from os import write as fdwrite Loading Loading @@ -118,14 +119,16 @@ async def _exec_io( stderr: IO[str]|IO[bytes]|int, kwargs: dict[str, Any], ) -> trio.Process: proc = await trio.open_process( [*coerce_args(cmd)], async with trio.open_nursery() as nursery: proc: trio.Process = await nursery.start( partial( trio.run_process, [*coerce_args(cmd)], stdin=PIPE if data else DEVNULL, stdout=PIPE, stderr=PIPE, stdout=PIPE, stderr=PIPE, check=False, **kwargs, ), ) async with proc, trio.open_nursery() as nursery: assert proc.stdout is not None and proc.stderr is not None nursery.start_soon(_passthru, proc.stderr, stderr) nursery.start_soon(_passthru, proc.stdout, stdout) Loading pyproject.toml +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ jsonpath-python = "~=1.0" orjson = "~=3.6" parse = "~=1.19" requests = "~=2.26" trio = "~=0.19" trio = "~=0.20.0" xdg = "~=5.1" packaging = "~=21" Loading Loading
behave_utils/proc.py +11 −8 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ from __future__ import annotations import io import sys from copy import copy from functools import partial from os import PathLike from os import fspath from os import write as fdwrite Loading Loading @@ -118,14 +119,16 @@ async def _exec_io( stderr: IO[str]|IO[bytes]|int, kwargs: dict[str, Any], ) -> trio.Process: proc = await trio.open_process( [*coerce_args(cmd)], async with trio.open_nursery() as nursery: proc: trio.Process = await nursery.start( partial( trio.run_process, [*coerce_args(cmd)], stdin=PIPE if data else DEVNULL, stdout=PIPE, stderr=PIPE, stdout=PIPE, stderr=PIPE, check=False, **kwargs, ), ) async with proc, trio.open_nursery() as nursery: assert proc.stdout is not None and proc.stderr is not None nursery.start_soon(_passthru, proc.stderr, stderr) nursery.start_soon(_passthru, proc.stdout, stdout) Loading
pyproject.toml +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ jsonpath-python = "~=1.0" orjson = "~=3.6" parse = "~=1.19" requests = "~=2.26" trio = "~=0.19" trio = "~=0.20.0" xdg = "~=5.1" packaging = "~=21" Loading