Avoid an error on empty lines.

This commit is contained in:
Eric S. Raymond 2010-01-19 12:27:38 +00:00
parent ad01f416b9
commit ff0347123d

View file

@ -316,7 +316,7 @@ if __name__ == '__main__':
else:
lines = after.split('\n')
for (i, line) in enumerate(lines):
if line[0] != '#':
if line and line[0] != '#':
lines[i] = lines[i].replace(old, new)
after = '\n'.join(lines)
if after != before: