ruff: Fix RUF021 Parenthesize when chaining and and or together.

This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-02-29 17:50:10 -08:00
committed by Tim Abbott
parent f618971668
commit 865febb307
5 changed files with 9 additions and 10 deletions

View File

@@ -674,7 +674,7 @@ def get_html_tag(text: str, i: int) -> str:
quote_count = 0
end = i + 1
unclosed_end = 0
while end < len(text) and (text[end] != ">" or quote_count % 2 != 0 and text[end] != "<"):
while end < len(text) and (text[end] != ">" or (quote_count % 2 != 0 and text[end] != "<")):
if text[end] == '"':
quote_count += 1
if not unclosed_end and text[end] == "<":