@@ -158,39 +158,42 @@ def __call__(self, output: Union[str, bytes], timestamp: datetime.datetime):
158158if sys .platform == "win32" :
159159 _ENV : TypeAlias = Mapping [str , str ]
160160else :
161- _ENV : TypeAlias = Mapping [bytes , StrOrBytesPath ] | Mapping [str , StrOrBytesPath ]
161+ _ENV : TypeAlias = Union [
162+ Mapping [bytes , StrOrBytesPath ], Mapping [str , StrOrBytesPath ]
163+ ]
162164
163165_CMD = Union [StrOrBytesPath , Sequence [StrOrBytesPath ]]
164- _FILE : TypeAlias = None | int | IO [Any ]
166+ _FILE : TypeAlias = Optional [ Union [ int , IO [Any ]] ]
165167
166168
167169def run (
168170 args : _CMD ,
169171 bufsize : int = - 1 ,
170- executable : StrOrBytesPath | None = None ,
171- stdin : _FILE | None = None ,
172- stdout : _FILE | None = None ,
173- stderr : _FILE | None = None ,
174- preexec_fn : Callable [[], Any ] | None = None ,
172+ executable : Optional [ StrOrBytesPath ] = None ,
173+ stdin : Optional [ _FILE ] = None ,
174+ stdout : Optional [ _FILE ] = None ,
175+ stderr : Optional [ _FILE ] = None ,
176+ preexec_fn : Optional [ Callable [[], Any ]] = None ,
175177 close_fds : bool = True ,
176178 shell : bool = False ,
177- cwd : StrOrBytesPath | None = None ,
178- env : _ENV | None = None ,
179- universal_newlines : bool | None = None ,
180- startupinfo : Any | None = None ,
179+ cwd : Optional [ StrOrBytesPath ] = None ,
180+ env : Optional [ _ENV ] = None ,
181+ universal_newlines : Optional [ bool ] = None ,
182+ startupinfo : Optional [ Any ] = None ,
181183 creationflags : int = 0 ,
182184 restore_signals : bool = True ,
183185 start_new_session : bool = False ,
184186 pass_fds : Any = (),
185187 * ,
186- text : bool | None = None ,
187- encoding : str | None = None ,
188- errors : str | None = None ,
189- user : str | int | None = None ,
190- group : str | int | None = None ,
191- extra_groups : Iterable [str | int ] | None = None ,
188+ text : Optional [ bool ] = None ,
189+ encoding : Optional [ str ] = None ,
190+ errors : Optional [ str ] = None ,
191+ user : Optional [ Union [ str , int ]] = None ,
192+ group : Optional [ Union [ str , int ]] = None ,
193+ extra_groups : Optional [ Iterable [Union [ str , int ]]] = None ,
192194 umask : int = - 1 ,
193- pipesize : int = - 1 ,
195+ # Not until sys.version_info >= (3, 10)
196+ # pipesize: int = -1,
194197 # custom
195198 log_in_real_time : bool = True ,
196199 check_returncode : bool = True ,
@@ -256,7 +259,6 @@ def progress_cb(output, timestamp):
256259 group = group ,
257260 extra_groups = extra_groups ,
258261 umask = umask ,
259- pipesize = pipesize ,
260262 )
261263
262264 all_output = []
0 commit comments