Kaydet (Commit) 54e5b89d authored tarafından Tim Peters's avatar Tim Peters

SF bug #497839: reindent chokes on empty first lines.

Reindenter.run():  copy over initial all-whitespace lines (if any, and
after normalizing to remove trailing blanks and tabs).
Bugfix candidate.
üst 41d97d67
...@@ -157,6 +157,10 @@ class Reindenter: ...@@ -157,6 +157,10 @@ class Reindenter:
have2want = {} have2want = {}
# Program after transformation. # Program after transformation.
after = self.after = [] after = self.after = []
# Copy over initial empty lines -- there's nothing to do until
# we see a line with *something* on it.
i = stats[0][0]
after.extend(lines[1:i])
for i in range(len(stats)-1): for i in range(len(stats)-1):
thisstmt, thislevel = stats[i] thisstmt, thislevel = stats[i]
nextstmt = stats[i+1][0] nextstmt = stats[i+1][0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment