summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2023-02-08 23:38:56 (GMT)
committerGitHub <noreply@github.com>2023-02-08 23:38:56 (GMT)
commit20cf32e761fb9eaccc142415b389998896869263 (patch)
treeb3d3a09b82a83ea72a24fbf46a77a9aa274e7ec1
parent23751ed826ee63fb486e874ec25934ea87dd8519 (diff)
downloadcpython-20cf32e761fb9eaccc142415b389998896869263.zip
cpython-20cf32e761fb9eaccc142415b389998896869263.tar.gz
cpython-20cf32e761fb9eaccc142415b389998896869263.tar.bz2
gh-101283: Fix use of unbound variable (GH-101712)
-rw-r--r--Lib/subprocess.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index fa527d5..1f203bd 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1494,6 +1494,8 @@ class Popen:
raise FileNotFoundError('shell not found: neither %ComSpec% nor %SystemRoot% is set')
if os.path.isabs(comspec):
executable = comspec
+ else:
+ comspec = executable
args = '{} /c "{}"'.format (comspec, args)