Commit 3d422d72 by Brian Marroquin Committed by Bjorn Neergaard

hoists args out of else block

parent 770a8148
...@@ -76,14 +76,13 @@ class Shell: ...@@ -76,14 +76,13 @@ class Shell:
# mypy requires using sys.platform instead of WINDOWS constant # mypy requires using sys.platform instead of WINDOWS constant
# in if statements to properly type check on Windows # in if statements to properly type check on Windows
if sys.platform == "win32": if sys.platform == "win32":
args = None
if self._name in ("powershell", "pwsh"): if self._name in ("powershell", "pwsh"):
args = ["-NoExit", "-File", str(activate_path)] args = ["-NoExit", "-File", str(activate_path)]
elif self._name == "cmd": elif self._name == "cmd":
# /K will execute the bat file and # /K will execute the bat file and
# keep the cmd process from terminating # keep the cmd process from terminating
args = ["/K", str(activate_path)] args = ["/K", str(activate_path)]
else:
args = None
if args: if args:
completed_proc = subprocess.run([self.path, *args]) completed_proc = subprocess.run([self.path, *args])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment