fix super call in list comprehension

This commit is contained in:
Tony Huang 2024-01-26 10:08:55 +08:00 committed by David Lord
parent 3435d2ff15
commit 1af8f95785
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
3 changed files with 10 additions and 1 deletions

View file

@ -858,7 +858,9 @@ class SeparatedPathType(click.Path):
self, value: t.Any, param: click.Parameter | None, ctx: click.Context | None
) -> t.Any:
items = self.split_envvar_value(value)
return [super().convert(item, param, ctx) for item in items]
# can't call no-arg super() inside list comprehension until Python 3.12
super_convert = super().convert
return [super_convert(item, param, ctx) for item in items]
@click.command("run", short_help="Run a development server.")