Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonykim1 committed Nov 6, 2024
1 parent ccebd33 commit 25b2f17
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions python_files/normalizeSelection.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

attach_bracket_paste = sys.version_info >= (3, 13)


def split_lines(source):
"""
Split selection lines in a version-agnostic way.
Expand Down Expand Up @@ -280,14 +281,20 @@ def get_next_block_lineno(which_line_next):
normalized = result["normalized_smart_result"]
which_line_next = result["which_line_next"]
if normalized == "deprecated":
data = json.dumps({"normalized": normalized, "attach_bracket_paste": attach_bracket_paste})
data = json.dumps(
{"normalized": normalized, "attach_bracket_paste": attach_bracket_paste}
)
else:
data = json.dumps(
{"normalized": normalized, "nextBlockLineno": result["which_line_next"], "attach_bracket_paste": attach_bracket_paste}
{
"normalized": normalized,
"nextBlockLineno": result["which_line_next"],
"attach_bracket_paste": attach_bracket_paste,
}
)
else:
normalized = normalize_lines(contents["code"])
data = json.dumps({"normalized": normalized, "attach_bracket_paste": attach_bracket_paste })
data = json.dumps({"normalized": normalized, "attach_bracket_paste": attach_bracket_paste})

stdout = sys.stdout if sys.version_info < (3,) else sys.stdout.buffer
stdout.write(data.encode("utf-8"))
Expand Down

0 comments on commit 25b2f17

Please sign in to comment.