Skip to content

Commit

Permalink
Ignore false positive B023 errors
Browse files Browse the repository at this point in the history
This may be related to
PyCQA/flake8-bugbear#269. These errors only
occur if flake8 is run with Python 3.8, which is odd.
  • Loading branch information
pgjones committed Jul 22, 2022
1 parent c7f10f4 commit dfdc7c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/werkzeug/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2007,8 +2007,10 @@ def match(
if isinstance(rule.redirect_to, str):

def _handle_match(match: t.Match[str]) -> str:
value = rv[match.group(1)] # type: ignore
return rule._converters[match.group(1)].to_url(value)
value = rv[match.group(1)] # type: ignore # noqa: B023
return rule._converters[match.group(1)].to_url( # noqa: B023
value
)

redirect_url = _simple_rule_re.sub(_handle_match, rule.redirect_to)
else:
Expand Down

0 comments on commit dfdc7c6

Please sign in to comment.