Merge pull request #7 from pemcconnell-anyvision/develop

Only attempt lines trim if the list isn't empty
This commit is contained in:
David Darias 2020-04-28 18:26:49 -04:00 committed by GitHub
commit 581f5c1e66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -106,7 +106,8 @@ def update_hosts_file():
break; break;
#remove all the trailing newlines on the line list #remove all the trailing newlines on the line list
while lines[-1].strip()=="": lines.pop() if lines:
while lines[-1].strip()=="": lines.pop()
#append all the domain lines #append all the domain lines
if len(hosts)>0: if len(hosts)>0: