Skip to content

Commit c9063c4

Browse files
committed
Remove walrus operator
1 parent 5ccd7ee commit c9063c4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pylsp_mypy/plugin.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,9 @@ def parse_line(line: str, document: Optional[Document] = None) -> Optional[Dict[
105105
"severity": errno,
106106
}
107107
if diag["range"]["end"]["character"] is None:
108-
diag["range"]["end"]["character"] = (
109-
offset + len(word)
110-
if (document and (word := document.word_at_position(diag["range"]["start"])))
111-
else offset + 1
112-
)
108+
if document:
109+
word = document.word_at_position(diag["range"]["start"])
110+
diag["range"]["end"]["character"] = offset + len(word) if word else offset + 1
113111

114112
return diag
115113
return None

0 commit comments

Comments
 (0)