Commit 3c666795 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Use stdin in proc if provided

Closes #22
parent c1eabd50
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -170,10 +170,11 @@ async def _exec_io(
	kwargs: dict[str, Any],
) -> trio.Process:
	async with trio.open_nursery() as nursery:
		stdin = kwargs.pop('stdin') if 'stdin' in kwargs else PIPE if data else DEVNULL
		proc: trio.Process = await nursery.start(
			partial(
				trio.run_process, [*coerce_args(cmd)],
				stdin=PIPE if data else DEVNULL,
				stdin=stdin,
				stdout=PIPE, stderr=PIPE,
				check=False,
				**kwargs,