Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix super call in list comprehension #5393

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Version 3.0.2
Unreleased

- Correct type for ``jinja_loader`` property. :issue:`5388`
- Fix error with ``--extra-files`` and ``--exclude-patterns`` CLI options.
:issue:`5391`


Version 3.0.1
Expand Down
4 changes: 3 additions & 1 deletion src/flask/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,9 @@ def convert(
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.")
Expand Down
5 changes: 5 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,3 +679,8 @@ def test_cli_empty(app):

result = app.test_cli_runner().invoke(args=["blue", "--help"])
assert result.exit_code == 2, f"Unexpected success:\n\n{result.output}"


def test_run_exclude_patterns():
ctx = run_command.make_context("run", ["--exclude-patterns", __file__])
assert ctx.params["exclude_patterns"] == [__file__]