Skip to content

Commit

Permalink
Revert "Do not truncate whitespace for multi-line string" (#24096)
Browse files Browse the repository at this point in the history
Reverts #23977

Have to revert #23977
with issue: #23743 due
to #24069

Will revisit why #23743
is breaking if contained inside other top level (in ast term) code
block, and look into how to support
#23743 without
breaking.
  • Loading branch information
anthonykim1 authored Sep 11, 2024
1 parent 08e7fdf commit 6578d9d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
4 changes: 0 additions & 4 deletions python_files/normalizeSelection.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ def _get_statements(selection):
This will remove empty newlines around and within the selection, dedent it,
and split it using the result of `ast.parse()`.
"""
if '"""' in selection or "'''" in selection:
yield selection
return

# Remove blank lines within the selection to prevent the REPL from thinking the block is finished.
lines = (line for line in split_lines(selection) if line.strip() != "")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
def add(x, y):
"""
Adds x
to
y
"""
"""Adds x to y"""
# Some comment
return x + y

v = add(1, 7)
print(v)

10 changes: 2 additions & 8 deletions src/test/python_files/terminalExec/sample2_raw.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
def add(x, y):
"""
Adds x
to
y
"""
"""Adds x to y"""
# Some comment

return x + y

v = add(1, 7)
Expand Down

0 comments on commit 6578d9d

Please sign in to comment.