Commit c6214e7f authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Update trio dependency to 0.20, switch to new run_process

parent 23bdfcb2
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -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
@@ -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)
+1 −1
Original line number Diff line number Diff line
@@ -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"