summaryrefslogtreecommitdiffstats
path: root/Misc/renumber.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-09-29 15:19:10 (GMT)
committerGuido van Rossum <guido@python.org>1994-09-29 15:19:10 (GMT)
commit457c0ab366e439abc36089e7440b36ac0517cedd (patch)
treee2ccadbe9b457f69e268de7aa765277106e442ca /Misc/renumber.py
parente5f6f45a99ccab1a6cf7b04b888fa103001b5005 (diff)
downloadcpython-457c0ab366e439abc36089e7440b36ac0517cedd.zip
cpython-457c0ab366e439abc36089e7440b36ac0517cedd.tar.gz
cpython-457c0ab366e439abc36089e7440b36ac0517cedd.tar.bz2
Fix bug in formatting of new questions
Diffstat (limited to 'Misc/renumber.py')
-rwxr-xr-xMisc/renumber.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Misc/renumber.py b/Misc/renumber.py
index a62257c..f2299b6 100755
--- a/Misc/renumber.py
+++ b/Misc/renumber.py
@@ -43,10 +43,12 @@ def main():
if n < 0: n = newquestionprog.match(line) - 3
if n >= 0:
question = question + 1
- line = '%d.%d. '%(chapter, question) + line[n:]
+ number = '%d.%d. '%(chapter, question)
+ line = number + line[n:]
lines[i] = line
questions.append(' ' + line)
# Add up to 4 continuations of the question
+ n = len(number)
for j in range(i+1, i+5):
if blankprog.match(lines[j]) >= 0:
break