Update migrate_config.py

Added if statement to prevent looping through header lines if configuration file is empty
This commit is contained in:
Jesse Bona 2019-02-01 19:15:59 +11:00 committed by GitHub
parent 35a78c06d0
commit 7b491c7110
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,8 @@ def _migrate_map(contents):
# Find the first non-header line # Find the first non-header line
lines = contents.splitlines(True) lines = contents.splitlines(True)
i = 0 i = 0
# Only loop on non empty configuration file
if i < len(lines):
while _is_header_line(lines[i]): while _is_header_line(lines[i]):
i += 1 i += 1