summaryrefslogtreecommitdiff
path: root/Lib/platform.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-07-14 09:17:18 -0700
committerGitHub <noreply@github.com>2021-07-14 17:17:18 +0100
commit5fc784e28ab9cd02c30395d1973ff825b787efa2 (patch)
tree235fdd74e43158147d32da075eeb7559564f56fa /Lib/platform.py
parent94adfe6e2cdc9ba715b6d7068d8bd521ba6bf30b (diff)
downloadcpython-git-5fc784e28ab9cd02c30395d1973ff825b787efa2.tar.gz
bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent erroneous STDIN consumption (GH-27092)
(cherry picked from commit 0ee0a740e12ec8568aafa033aa6bb08b265afe26) Co-authored-by: Konstantin-Glukhov <glukhov.k@gmail.com>
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-xLib/platform.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/platform.py b/Lib/platform.py
index 0bce4381cc..d6412e169b 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -280,6 +280,7 @@ def _syscmd_ver(system='', release='', version='',
for cmd in ('ver', 'command /c ver', 'cmd /c ver'):
try:
info = subprocess.check_output(cmd,
+ stdin=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
text=True,
shell=True)