From 8652830bb9f5668f951eb35ae2037fd1539a8535 Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Wed, 11 Sep 2024 11:11:53 -0700 Subject: [PATCH 1/5] revert changes for triple string --- python_files/normalizeSelection.py | 3 --- .../terminalExec/sample2_normalized_selection.py | 9 +-------- src/test/python_files/terminalExec/sample2_raw.py | 10 ++-------- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/python_files/normalizeSelection.py b/python_files/normalizeSelection.py index 7ea283cc09a6..bf112da0e2a1 100644 --- a/python_files/normalizeSelection.py +++ b/python_files/normalizeSelection.py @@ -26,9 +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() != "") diff --git a/src/test/python_files/terminalExec/sample2_normalized_selection.py b/src/test/python_files/terminalExec/sample2_normalized_selection.py index be7b280479c0..904c8294be31 100644 --- a/src/test/python_files/terminalExec/sample2_normalized_selection.py +++ b/src/test/python_files/terminalExec/sample2_normalized_selection.py @@ -1,12 +1,5 @@ def add(x, y): - """ - - Adds x - to - y - - - """ + """Adds x to y""" # Some comment return x + y diff --git a/src/test/python_files/terminalExec/sample2_raw.py b/src/test/python_files/terminalExec/sample2_raw.py index 230abfda89cb..b44b2cd78a0c 100644 --- a/src/test/python_files/terminalExec/sample2_raw.py +++ b/src/test/python_files/terminalExec/sample2_raw.py @@ -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) From e554f1c923569f1c29f4d3a940fbcb5cce0a80ab Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Wed, 11 Sep 2024 11:17:33 -0700 Subject: [PATCH 2/5] lint seriously --- python_files/normalizeSelection.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python_files/normalizeSelection.py b/python_files/normalizeSelection.py index bf112da0e2a1..d59f07df9e16 100644 --- a/python_files/normalizeSelection.py +++ b/python_files/normalizeSelection.py @@ -22,7 +22,6 @@ def split_lines(source): def _get_statements(selection): """Process a multiline selection into a list of its top-level statements. - This will remove empty newlines around and within the selection, dedent it, and split it using the result of `ast.parse()`. """ From 17f1cb9adc3c98e7f21d4b52f3114f9740d0f566 Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Wed, 11 Sep 2024 11:59:44 -0700 Subject: [PATCH 3/5] try --- src/test/python_files/terminalExec/sample2_raw.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/python_files/terminalExec/sample2_raw.py b/src/test/python_files/terminalExec/sample2_raw.py index b44b2cd78a0c..a333d4e0daae 100644 --- a/src/test/python_files/terminalExec/sample2_raw.py +++ b/src/test/python_files/terminalExec/sample2_raw.py @@ -1,7 +1,6 @@ def add(x, y): """Adds x to y""" # Some comment - return x + y v = add(1, 7) From b0acb183919d4de287ddad9fe9a606afa3aa4cea Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Wed, 11 Sep 2024 13:15:31 -0700 Subject: [PATCH 4/5] is it the newline --- .../python_files/terminalExec/sample2_normalized_selection.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/python_files/terminalExec/sample2_normalized_selection.py b/src/test/python_files/terminalExec/sample2_normalized_selection.py index 904c8294be31..65bb866eefb7 100644 --- a/src/test/python_files/terminalExec/sample2_normalized_selection.py +++ b/src/test/python_files/terminalExec/sample2_normalized_selection.py @@ -6,3 +6,4 @@ def add(x, y): v = add(1, 7) print(v) + From 119beaf9e523eab7dfb379333932ec70c5ea1670 Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Wed, 11 Sep 2024 13:34:53 -0700 Subject: [PATCH 5/5] remove space --- .../python_files/terminalExec/sample2_normalized_selection.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/test/python_files/terminalExec/sample2_normalized_selection.py b/src/test/python_files/terminalExec/sample2_normalized_selection.py index 65bb866eefb7..a333d4e0daae 100644 --- a/src/test/python_files/terminalExec/sample2_normalized_selection.py +++ b/src/test/python_files/terminalExec/sample2_normalized_selection.py @@ -5,5 +5,3 @@ def add(x, y): v = add(1, 7) print(v) - -