|
6 | 6 |
|
7 | 7 | from astroid.brain.helpers import register_module_extender
|
8 | 8 | from astroid.builder import parse
|
9 |
| -from astroid.const import PY39_PLUS |
| 9 | +from astroid.const import PY39_PLUS, PY310_PLUS, PY311_PLUS |
10 | 10 | from astroid.manager import AstroidManager
|
11 | 11 |
|
12 | 12 |
|
13 | 13 | def _subprocess_transform():
|
14 | 14 | communicate = (bytes("string", "ascii"), bytes("string", "ascii"))
|
15 | 15 | communicate_signature = "def communicate(self, input=None, timeout=None)"
|
16 | 16 | args = """\
|
17 |
| - self, args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, |
18 |
| - preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, |
19 |
| - universal_newlines=False, startupinfo=None, creationflags=0, restore_signals=True, |
| 17 | + self, args, bufsize=-1, executable=None, stdin=None, stdout=None, stderr=None, |
| 18 | + preexec_fn=None, close_fds=True, shell=False, cwd=None, env=None, |
| 19 | + universal_newlines=None, startupinfo=None, creationflags=0, restore_signals=True, |
20 | 20 | start_new_session=False, pass_fds=(), *, encoding=None, errors=None, text=None"""
|
| 21 | + |
| 22 | + if PY39_PLUS: |
| 23 | + args += ", user=None, group=None, extra_groups=None, umask=-1" |
| 24 | + if PY310_PLUS: |
| 25 | + args += ", pipesize=-1" |
| 26 | + if PY311_PLUS: |
| 27 | + args += ", process_group=None" |
| 28 | + |
21 | 29 | init = f"""
|
22 | 30 | def __init__({args}):
|
23 | 31 | pass"""
|
|
0 commit comments