diff options
author | Rémi Lapeyre <remi.lapeyre@lenstra.fr> | 2021-09-20 15:09:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-20 15:09:05 (GMT) |
commit | 4d2957c1b9a915f76da418e89bf9b5add141ca3e (patch) | |
tree | c69d8a5b4c23e4800f877945f727a5786cb50717 /Lib/subprocess.py | |
parent | ef9e22b253253615098d22cb49141a2a1024ee3c (diff) | |
download | cpython-4d2957c1b9a915f76da418e89bf9b5add141ca3e.zip cpython-4d2957c1b9a915f76da418e89bf9b5add141ca3e.tar.gz cpython-4d2957c1b9a915f76da418e89bf9b5add141ca3e.tar.bz2 |
bpo-40497: Fix handling of check in subprocess.check_output() (GH-19897)
Co-authored-by: Tal Einat <taleinat@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r-- | Lib/subprocess.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index dd1174e..33f022f 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -405,8 +405,9 @@ def check_output(*popenargs, timeout=None, **kwargs): decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. """ - if 'stdout' in kwargs: - raise ValueError('stdout argument not allowed, it will be overridden.') + for kw in ('stdout', 'check'): + if kw in kwargs: + raise ValueError(f'{kw} argument not allowed, it will be overridden.') if 'input' in kwargs and kwargs['input'] is None: # Explicitly passing input=None was previously equivalent to passing an |