Skip to content

Commit

Permalink
more compact fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Aug 31, 2022
1 parent ef7c076 commit 9886340
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions 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
Expand All @@ -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)

0 comments on commit 9886340

Please sign in to comment.