[Python-checkins] gh-101283: Fix use of unbound variable (GH-101712)
zooba
webhook-mailer at python.org
Wed Feb 8 18:39:27 EST 2023
https://github.com/python/cpython/commit/20cf32e761fb9eaccc142415b389998896869263
commit: 20cf32e761fb9eaccc142415b389998896869263
branch: main
author: Steve Dower <steve.dower at python.org>
committer: zooba <steve.dower at microsoft.com>
date: 2023-02-08T23:38:56Z
summary:
gh-101283: Fix use of unbound variable (GH-101712)
files:
M Lib/subprocess.py
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index fa527d50ebb4..1f203bd00d35 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1494,6 +1494,8 @@ def _execute_child(self, args, executable, preexec_fn, close_fds,
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)
More information about the Python-checkins
mailing list