aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/_pyrepl/readline.py
diff options
context:
space:
mode:
authorArnon Yaari <wiggin15@yahoo.com>2024-09-06 10:33:40 +0300
committerGitHub <noreply@github.com>2024-09-06 07:33:40 +0000
commitd683f49a7b0635a26150cfbb398a3d93b227a74e (patch)
tree053b00ac18ec291c35899ae9cbf13ec40c21124f /Lib/_pyrepl/readline.py
parent67957ea77da8c667df1508a9d3d9b39e59f671d6 (diff)
downloadcpython-d683f49a7b0635a26150cfbb398a3d93b227a74e.tar.gz
cpython-d683f49a7b0635a26150cfbb398a3d93b227a74e.zip
gh-111201: fix auto-indent in pyrepl for muliple pound comments (#123196)
Diffstat (limited to 'Lib/_pyrepl/readline.py')
-rw-r--r--Lib/_pyrepl/readline.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/_pyrepl/readline.py b/Lib/_pyrepl/readline.py
index dfacfd84999..a6ef138e8b4 100644
--- a/Lib/_pyrepl/readline.py
+++ b/Lib/_pyrepl/readline.py
@@ -249,7 +249,7 @@ def _should_auto_indent(buffer: list[str], pos: int) -> bool:
while pos > 0:
pos -= 1
if last_char is None:
- if buffer[pos] not in " \t\n": # ignore whitespaces
+ if buffer[pos] not in " \t\n#": # ignore whitespaces and comments
last_char = buffer[pos]
else:
# even if we found a non-whitespace character before