1
1
# Stubs for subprocess
2
2
3
- # Based on http://docs.python.org/3.5 /library/subprocess.html
3
+ # Based on http://docs.python.org/3.6 /library/subprocess.html
4
4
import sys
5
5
from typing import Sequence , Any , AnyStr , Mapping , Callable , Tuple , IO , Optional , Union , List , Type
6
6
from types import TracebackType
7
7
8
-
9
8
if sys .version_info >= (3 , 5 ):
10
9
class CompletedProcess :
11
10
args = ... # type: Union[Sequence[str], str]
@@ -18,27 +17,52 @@ if sys.version_info >= (3, 5):
18
17
stderr : Union [str , bytes , None ] = ...) -> None : ...
19
18
def check_returncode (self ) -> None : ...
20
19
21
- # Nearly same args as Popen.__init__ except for timeout, input, and check
22
- def run (args : Union [str , Sequence [str ]],
23
- timeout : float = ...,
24
- input : Union [str , bytes ] = ...,
25
- check : bool = ...,
26
- bufsize : int = ...,
27
- executable : str = ...,
28
- stdin : Any = ...,
29
- stdout : Any = ...,
30
- stderr : Any = ...,
31
- preexec_fn : Callable [[], Any ] = ...,
32
- close_fds : bool = ...,
33
- shell : bool = ...,
34
- cwd : str = ...,
35
- env : Mapping [str , str ] = ...,
36
- universal_newlines : bool = ...,
37
- startupinfo : Any = ...,
38
- creationflags : int = ...,
39
- restore_signals : bool = ...,
40
- start_new_session : bool = ...,
41
- pass_fds : Any = ...) -> CompletedProcess : ...
20
+ if sys .version_info >= (3 , 6 ):
21
+ # Nearly same args as Popen.__init__ except for timeout, input, and check
22
+ def run (args : Union [str , Sequence [str ]],
23
+ timeout : float = ...,
24
+ input : Union [str , bytes ] = ...,
25
+ check : bool = ...,
26
+ bufsize : int = ...,
27
+ executable : str = ...,
28
+ stdin : Any = ...,
29
+ stdout : Any = ...,
30
+ stderr : Any = ...,
31
+ preexec_fn : Callable [[], Any ] = ...,
32
+ close_fds : bool = ...,
33
+ shell : bool = ...,
34
+ cwd : str = ...,
35
+ env : Mapping [str , str ] = ...,
36
+ universal_newlines : bool = ...,
37
+ startupinfo : Any = ...,
38
+ creationflags : int = ...,
39
+ restore_signals : bool = ...,
40
+ start_new_session : bool = ...,
41
+ pass_fds : Any = ...,
42
+ encoding : str = ...,
43
+ errors : str = ...) -> CompletedProcess : ...
44
+ else :
45
+ # Nearly same args as Popen.__init__ except for timeout, input, and check
46
+ def run (args : Union [str , Sequence [str ]],
47
+ timeout : float = ...,
48
+ input : Union [str , bytes ] = ...,
49
+ check : bool = ...,
50
+ bufsize : int = ...,
51
+ executable : str = ...,
52
+ stdin : Any = ...,
53
+ stdout : Any = ...,
54
+ stderr : Any = ...,
55
+ preexec_fn : Callable [[], Any ] = ...,
56
+ close_fds : bool = ...,
57
+ shell : bool = ...,
58
+ cwd : str = ...,
59
+ env : Mapping [str , str ] = ...,
60
+ universal_newlines : bool = ...,
61
+ startupinfo : Any = ...,
62
+ creationflags : int = ...,
63
+ restore_signals : bool = ...,
64
+ start_new_session : bool = ...,
65
+ pass_fds : Any = ...) -> CompletedProcess : ...
42
66
43
67
# Same args as Popen.__init__
44
68
if sys .version_info >= (3 , 3 ):
@@ -207,24 +231,46 @@ class Popen:
207
231
pid = 0
208
232
returncode = 0
209
233
210
- def __init__ (self ,
211
- args : Union [str , Sequence [str ]],
212
- bufsize : int = ...,
213
- executable : Optional [str ] = ...,
214
- stdin : Optional [Any ] = ...,
215
- stdout : Optional [Any ] = ...,
216
- stderr : Optional [Any ] = ...,
217
- preexec_fn : Optional [Callable [[], Any ]] = ...,
218
- close_fds : bool = ...,
219
- shell : bool = ...,
220
- cwd : Optional [str ] = ...,
221
- env : Optional [Mapping [str , str ]] = ...,
222
- universal_newlines : bool = ...,
223
- startupinfo : Optional [Any ] = ...,
224
- creationflags : int = ...,
225
- restore_signals : bool = ...,
226
- start_new_session : bool = ...,
227
- pass_fds : Any = ...) -> None : ...
234
+ if sys .version_info >= (3 , 6 ):
235
+ def __init__ (self ,
236
+ args : Union [str , Sequence [str ]],
237
+ bufsize : int = ...,
238
+ executable : Optional [str ] = ...,
239
+ stdin : Optional [Any ] = ...,
240
+ stdout : Optional [Any ] = ...,
241
+ stderr : Optional [Any ] = ...,
242
+ preexec_fn : Optional [Callable [[], Any ]] = ...,
243
+ close_fds : bool = ...,
244
+ shell : bool = ...,
245
+ cwd : Optional [str ] = ...,
246
+ env : Optional [Mapping [str , str ]] = ...,
247
+ universal_newlines : bool = ...,
248
+ startupinfo : Optional [Any ] = ...,
249
+ creationflags : int = ...,
250
+ restore_signals : bool = ...,
251
+ start_new_session : bool = ...,
252
+ pass_fds : Any = ...,
253
+ encoding : str = ...,
254
+ errors : str = ...) -> None : ...
255
+ else :
256
+ def __init__ (self ,
257
+ args : Union [str , Sequence [str ]],
258
+ bufsize : int = ...,
259
+ executable : Optional [str ] = ...,
260
+ stdin : Optional [Any ] = ...,
261
+ stdout : Optional [Any ] = ...,
262
+ stderr : Optional [Any ] = ...,
263
+ preexec_fn : Optional [Callable [[], Any ]] = ...,
264
+ close_fds : bool = ...,
265
+ shell : bool = ...,
266
+ cwd : Optional [str ] = ...,
267
+ env : Optional [Mapping [str , str ]] = ...,
268
+ universal_newlines : bool = ...,
269
+ startupinfo : Optional [Any ] = ...,
270
+ creationflags : int = ...,
271
+ restore_signals : bool = ...,
272
+ start_new_session : bool = ...,
273
+ pass_fds : Any = ...) -> None : ...
228
274
229
275
def poll (self ) -> int : ...
230
276
if sys .version_info >= (3 , 3 ):
0 commit comments