Skip to content

Commit

Permalink
Merge pull request #769 from nolar/click8
Browse files Browse the repository at this point in the history
Fix an issue with Click 8.0.0 for custom type double-conversion
  • Loading branch information
nolar authored May 13, 2021
2 parents a94648d + 3a11de4 commit c221619
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kopf/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ def __init__(self) -> None:
super().__init__(choices=[v.name.lower() for v in loggers.LogFormat])

def convert(self, value: Any, param: Any, ctx: Any) -> loggers.LogFormat:
name: str = super().convert(value, param, ctx)
return loggers.LogFormat[name.upper()]
if isinstance(value, loggers.LogFormat):
return value
else:
name: str = super().convert(value, param, ctx)
return loggers.LogFormat[name.upper()]


def logging_options(fn: Callable[..., Any]) -> Callable[..., Any]:
Expand Down

0 comments on commit c221619

Please sign in to comment.