diff --git a/src/poetry/console/application.py b/src/poetry/console/application.py index 274cfcfc498..2b6bd633c50 100644 --- a/src/poetry/console/application.py +++ b/src/poetry/console/application.py @@ -276,9 +276,10 @@ def configure_env( self, event: ConsoleCommandEvent, event_name: str, _: Any ) -> None: from poetry.console.commands.env_command import EnvCommand + from poetry.console.commands.self.self_command import SelfCommand command = event.command - if not isinstance(command, EnvCommand): + if not isinstance(command, EnvCommand) or isinstance(command, SelfCommand): return if command._env is not None: