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 10a4e2d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/poetry/plugins/application_plugin.py
Original file line number Diff line number Diff line change
@@ -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,6 @@ 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 10a4e2d

Please sign in to comment.