Skip to content

Commit 073c2dd

Browse files
bmarroquinneersighted
authored andcommitted
hoists args out of else block
(cherry picked from commit 3d422d7)
1 parent 33e948c commit 073c2dd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/poetry/utils/shell.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,13 @@ def activate(self, env: VirtualEnv) -> int | None:
7676
# mypy requires using sys.platform instead of WINDOWS constant
7777
# in if statements to properly type check on Windows
7878
if sys.platform == "win32":
79+
args = None
7980
if self._name in ("powershell", "pwsh"):
8081
args = ["-NoExit", "-File", str(activate_path)]
8182
elif self._name == "cmd":
8283
# /K will execute the bat file and
8384
# keep the cmd process from terminating
8485
args = ["/K", str(activate_path)]
85-
else:
86-
args = None
8786

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

0 commit comments

Comments
 (0)