@@ -409,9 +409,7 @@ def _setup(self, command: str, kwargs: Any) -> None:
409409 # Normalize kwargs w/ config; sets self.opts, self.streams
410410 self ._unify_kwargs_with_config (kwargs )
411411 # Environment setup
412- self .env = self .generate_env (
413- self .opts ["env" ], self .opts ["replace_env" ]
414- )
412+ self .env = self .generate_env (self .opts ["env" ], self .opts ["replace_env" ])
415413 # Arrive at final encoding if neither config nor kwargs had one
416414 self .encoding = self .opts ["encoding" ] or self .default_encoding ()
417415 # Echo running command (wants to be early to be included in dry-run)
@@ -546,7 +544,9 @@ def _unify_kwargs_with_config(self, kwargs: Any) -> None:
546544 self ._asynchronous = opts ["asynchronous" ]
547545 self ._disowned = opts ["disown" ]
548546 if self ._asynchronous and self ._disowned :
549- err = "Cannot give both 'asynchronous' and 'disown' at the same time!" # noqa
547+ err = (
548+ "Cannot give both 'asynchronous' and 'disown' at the same time!" # noqa
549+ )
550550 raise ValueError (err )
551551 # If hide was True, turn off echoing
552552 if opts ["hide" ] is True :
@@ -602,9 +602,7 @@ def _collate_result(self, watcher_errors: List[WatcherError]) -> "Result":
602602 # TODO: as noted elsewhere, I kinda hate this. Consider changing
603603 # generate_result()'s API in next major rev so we can tidy up.
604604 result = self .generate_result (
605- ** dict (
606- self .result_kwargs , stdout = stdout , stderr = stderr , exited = exited
607- )
605+ ** dict (self .result_kwargs , stdout = stdout , stderr = stderr , exited = exited )
608606 )
609607 return result
610608
@@ -755,9 +753,7 @@ def _handle_output(
755753 # Run our specific buffer through the autoresponder framework
756754 self .respond (buffer_ )
757755
758- def handle_stdout (
759- self , buffer_ : List [str ], hide : bool , output : IO
760- ) -> None :
756+ def handle_stdout (self , buffer_ : List [str ], hide : bool , output : IO ) -> None :
761757 """
762758 Read process' stdout, storing into a buffer & printing/parsing.
763759
@@ -774,13 +770,9 @@ def handle_stdout(
774770
775771 .. versionadded:: 1.0
776772 """
777- self ._handle_output (
778- buffer_ , hide , output , reader = self .read_proc_stdout
779- )
773+ self ._handle_output (buffer_ , hide , output , reader = self .read_proc_stdout )
780774
781- def handle_stderr (
782- self , buffer_ : List [str ], hide : bool , output : IO
783- ) -> None :
775+ def handle_stderr (self , buffer_ : List [str ], hide : bool , output : IO ) -> None :
784776 """
785777 Read process' stderr, storing into a buffer & printing/parsing.
786778
@@ -789,9 +781,7 @@ def handle_stderr(
789781
790782 .. versionadded:: 1.0
791783 """
792- self ._handle_output (
793- buffer_ , hide , output , reader = self .read_proc_stderr
794- )
784+ self ._handle_output (buffer_ , hide , output , reader = self .read_proc_stderr )
795785
796786 def read_our_stdin (self , input_ : IO ) -> Optional [str ]:
797787 """
@@ -940,9 +930,7 @@ def respond(self, buffer_: List[str]) -> None:
940930 for response in watcher .submit (stream ):
941931 self .write_proc_stdin (response )
942932
943- def generate_env (
944- self , env : Dict [str , Any ], replace_env : bool
945- ) -> Dict [str , Any ]:
933+ def generate_env (self , env : Dict [str , Any ], replace_env : bool ) -> Dict [str , Any ]:
946934 """
947935 Return a suitable environment dict based on user input & behavior.
948936
@@ -1283,9 +1271,7 @@ def _write_proc_stdin(self, data: bytes) -> None:
12831271 elif self .process and self .process .stdin :
12841272 fd = self .process .stdin .fileno ()
12851273 else :
1286- raise SubprocessPipeError (
1287- "Unable to write to missing subprocess or stdin!"
1288- )
1274+ raise SubprocessPipeError ("Unable to write to missing subprocess or stdin!" )
12891275 # Try to write, ignoring broken pipes if encountered (implies child
12901276 # process exited before the process piping stdin to us finished;
12911277 # there's nothing we can do about that!)
@@ -1303,9 +1289,7 @@ def close_proc_stdin(self) -> None:
13031289 elif self .process and self .process .stdin :
13041290 self .process .stdin .close ()
13051291 else :
1306- raise SubprocessPipeError (
1307- "Unable to close missing subprocess or stdin!"
1308- )
1292+ raise SubprocessPipeError ("Unable to close missing subprocess or stdin!" )
13091293
13101294 def start (self , command : str , shell : str , env : Dict [str , Any ]) -> None :
13111295 if self .using_pty :
0 commit comments