]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-101283: Fix use of unbound variable (GH-101712)
authorSteve Dower <steve.dower@python.org>
Wed, 8 Feb 2023 23:38:56 +0000 (23:38 +0000)
committerGitHub <noreply@github.com>
Wed, 8 Feb 2023 23:38:56 +0000 (23:38 +0000)
Lib/subprocess.py

index fa527d50ebb44d5635d804e4051779d3d946bbe6..1f203bd00d350031161c3b893425f48a44318f0f 100644 (file)
@@ -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)