Skip to content

Commit 6578d9d

Browse files
authored
Revert "Do not truncate whitespace for multi-line string" (#24096)
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.
1 parent 08e7fdf commit 6578d9d

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

python_files/normalizeSelection.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ def _get_statements(selection):
2626
This will remove empty newlines around and within the selection, dedent it,
2727
and split it using the result of `ast.parse()`.
2828
"""
29-
if '"""' in selection or "'''" in selection:
30-
yield selection
31-
return
32-
3329
# Remove blank lines within the selection to prevent the REPL from thinking the block is finished.
3430
lines = (line for line in split_lines(selection) if line.strip() != "")
3531

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
def add(x, y):
2-
"""
3-
4-
Adds x
5-
to
6-
y
7-
8-
9-
"""
2+
"""Adds x to y"""
103
# Some comment
114
return x + y
125

136
v = add(1, 7)
147
print(v)
15-

src/test/python_files/terminalExec/sample2_raw.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
def add(x, y):
2-
"""
3-
4-
Adds x
5-
to
6-
y
7-
8-
9-
"""
2+
"""Adds x to y"""
103
# Some comment
4+
115
return x + y
126

137
v = add(1, 7)

0 commit comments

Comments
 (0)