summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-03-13 14:50:24 (GMT)
committerGuido van Rossum <guido@python.org>2000-03-13 14:50:24 (GMT)
commit7f1cd296c6ec370a6a8eaf5e0ac53e8c9f0548de (patch)
tree7f45042d67f962059687e513e5a65eae34a20eea /Tools
parent76bd689a8dc3abd237ad831f95f5341ef80f437e (diff)
downloadcpython-7f1cd296c6ec370a6a8eaf5e0ac53e8c9f0548de.zip
cpython-7f1cd296c6ec370a6a8eaf5e0ac53e8c9f0548de.tar.gz
cpython-7f1cd296c6ec370a6a8eaf5e0ac53e8c9f0548de.tar.bz2
Tim Peters writes:
Fix bad auto-indent I recently introduced when replacing the regexp that could cause re to blow up: if or_any_other_block_opener: # one indenting comment line ^ cursor ended up at the caret (the bug) ^ but belongs here (the post-patch behavior)
Diffstat (limited to 'Tools')
-rw-r--r--Tools/idle/PyParse.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Tools/idle/PyParse.py b/Tools/idle/PyParse.py
index 23b995c..40b6726 100644
--- a/Tools/idle/PyParse.py
+++ b/Tools/idle/PyParse.py
@@ -385,13 +385,14 @@ class Parser:
m = _chew_ordinaryre(str, p, q)
if m:
# we skipped at least one boring char
- p = m.end()
+ newp = m.end()
# back up over totally boring whitespace
- i = p-1 # index of last boring char
- while i >= 0 and str[i] in " \t\n":
+ i = newp - 1 # index of last boring char
+ while i >= p and str[i] in " \t\n":
i = i-1
- if i >= 0:
+ if i >= p:
lastch = str[i]
+ p = newp
if p >= q:
break