Skip to content

Commit

Permalink
hoists args out of else block
Browse files Browse the repository at this point in the history
(cherry picked from commit 3d422d7)
  • Loading branch information
bmarroquin authored and neersighted committed Oct 8, 2022
1 parent 33e948c commit 073c2dd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/poetry/utils/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,13 @@ def activate(self, env: VirtualEnv) -> int | None:
# mypy requires using sys.platform instead of WINDOWS constant
# in if statements to properly type check on Windows
if sys.platform == "win32":
args = None
if self._name in ("powershell", "pwsh"):
args = ["-NoExit", "-File", str(activate_path)]
elif self._name == "cmd":
# /K will execute the bat file and
# keep the cmd process from terminating
args = ["/K", str(activate_path)]
else:
args = None

if args:
completed_proc = subprocess.run([self.path, *args])
Expand Down

0 comments on commit 073c2dd

Please sign in to comment.