Skip to content

Commit

Permalink
hoists args out of else block
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarroquin committed Sep 19, 2022
1 parent 5176b58 commit 463d70a
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 463d70a

Please sign in to comment.