Skip to content

Commit a490386

Browse files
authored
fix: skip configure env for SelfCommand (#6225)
At the moment a venv is created on running a `poetry self` command. Even if it is not used in the command itself it's unnecessary and lead to problems as reported in #6222. This PR fixes this. Resolves: #6222
1 parent 75cf77b commit a490386

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/poetry/console/application.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,10 @@ def configure_env(
276276
self, event: ConsoleCommandEvent, event_name: str, _: Any
277277
) -> None:
278278
from poetry.console.commands.env_command import EnvCommand
279+
from poetry.console.commands.self.self_command import SelfCommand
279280

280281
command = event.command
281-
if not isinstance(command, EnvCommand):
282+
if not isinstance(command, EnvCommand) or isinstance(command, SelfCommand):
282283
return
283284

284285
if command._env is not None:

0 commit comments

Comments
 (0)