From 2fb0983be64de51474b955ff2f3224e5139fa266 Mon Sep 17 00:00:00 2001 From: Ben Mather Date: Mon, 28 Oct 2024 21:15:37 +0000 Subject: [PATCH] Fix pylint warings about unassigned variables --- src/ssort/_parsing.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ssort/_parsing.py b/src/ssort/_parsing.py index 969d81f..214d3b8 100644 --- a/src/ssort/_parsing.py +++ b/src/ssort/_parsing.py @@ -49,12 +49,14 @@ def split( next_node = next(nodes, None) - if next_node is not None: - next_start_row, next_start_col = _find_start(next_node) - next_end_row, next_end_col = _find_end(next_node) + if next_node is None: + return - indent_text = " " * next_node.col_offset - next_indent_text = "" + next_start_row, next_start_col = _find_start(next_node) + next_end_row, next_end_col = _find_end(next_node) + + indent_text = " " * next_node.col_offset + next_indent_text = "" while next_node: this_node, next_node = next_node, next(nodes, None)