Skip to content

Commit

Permalink
Fix shell.py (python-poetry#7245)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimstunt committed Jan 31, 2023
1 parent 19133be commit 35aa9b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/poetry/utils/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ def activate(self, env: VirtualEnv) -> int | None:
c.setecho(False)
if self._name == "zsh":
# Under ZSH the source command should be invoked in zsh's bash emulator
c.sendline(f'''emulate bash -c ". {shlex.quote(str(activate_path))}"''')
quoted_activate_path = shlex.quote(str(activate_path))
c.sendline(
f"emulate bash -c {shlex.quote(f'. {quoted_activate_path}')}"
)
else:
c.sendline(
f"{self._get_source_command()} {shlex.quote(str(activate_path))}"
Expand Down

0 comments on commit 35aa9b6

Please sign in to comment.