Update migrate_config.py

Corrected loop condition to not run if configuration file only contains new lines.
This commit is contained in:
Jesse Bona
2019-02-02 10:34:53 +11:00
committed by GitHub
parent 7b491c7110
commit f2be2ead35

View File

@@ -22,9 +22,8 @@ def _migrate_map(contents):
lines = contents.splitlines(True)
i = 0
# Only loop on non empty configuration file
if i < len(lines):
while _is_header_line(lines[i]):
i += 1
while i < len(lines) and _is_header_line(lines[i]):
i += 1
header = ''.join(lines[:i])
rest = ''.join(lines[i:])