From 9886340d4bb96fad87b36d427a1593c3f1d5eb63 Mon Sep 17 00:00:00 2001 From: David Hotham Date: Wed, 31 Aug 2022 19:56:08 +0100 Subject: [PATCH] more compact fix --- src/poetry/plugins/application_plugin.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/poetry/plugins/application_plugin.py b/src/poetry/plugins/application_plugin.py index 4b2c8f905f4..44f7ecf42e3 100644 --- a/src/poetry/plugins/application_plugin.py +++ b/src/poetry/plugins/application_plugin.py @@ -1,7 +1,5 @@ from __future__ import annotations -import functools - from typing import TYPE_CHECKING from poetry.plugins.base_plugin import BasePlugin @@ -24,12 +22,7 @@ def commands(self) -> list[type[Command]]: return [] def activate(self, application: Application) -> None: - def factory(command: type[Command]) -> Command: - return command() - for command in self.commands: assert command.name is not None - application.command_loader.register_factory( - command.name, functools.partial(factory, command) - ) + application.command_loader.register_factory(command.name, command)