@@ -31,18 +31,20 @@ async def try_captured(*args, timeout: float | None = None):
3131 raise GRPCError (
3232 Status .INTERNAL ,
3333 f"{ _format_command_preview (args )} failed: { result .returncode = } " ,
34- result .combined
34+ result .combined ,
3535 )
3636 return result
3737
3838
39- async def try_console (* args , log_level : int = logging .DEBUG , timeout : float | None = None ):
39+ async def try_console (
40+ * args , log_level : int = logging .DEBUG , timeout : float | None = None
41+ ):
4042 result = await run_console (* args , log_level = log_level , timeout = timeout )
4143 if result .returncode != 0 :
4244 raise GRPCError (
4345 Status .INTERNAL ,
4446 f"{ _format_command_preview (args )} failed: { result .returncode = } " ,
45- result .combined
47+ result .combined ,
4648 )
4749 return result
4850
@@ -53,7 +55,9 @@ async def run_captured(*args, timeout: float | None = None):
5355
5456
5557# Run async subprocess, forward output to console and return returncode
56- async def run_console (* args , log_level : int = logging .DEBUG , timeout : float | None = None ):
58+ async def run_console (
59+ * args , log_level : int = logging .DEBUG , timeout : float | None = None
60+ ):
5761 start_time = time .perf_counter ()
5862 log_command (* args , log_level = log_level )
5963 proc = await asyncio .create_subprocess_exec (
@@ -84,12 +88,15 @@ async def stream_output(stream, buffer):
8488 stream_output (proc .stderr , stderr_data ),
8589 proc .wait (),
8690 ),
87- timeout = timeout
91+ timeout = timeout ,
8892 )
8993 except asyncio .TimeoutError :
9094 proc .kill ()
9195 await proc .wait ()
92- raise GRPCError (Status .DEADLINE_EXCEEDED , f"Command timed out after { timeout } s: { _format_command_preview (args )} " )
96+ raise GRPCError (
97+ Status .DEADLINE_EXCEEDED ,
98+ f"Command timed out after { timeout } s: { _format_command_preview (args )} " ,
99+ )
93100
94101 elapsed_time = time .perf_counter () - start_time
95102 if elapsed_time > 5 :
0 commit comments