forked from docker/docker-hoster
Only attempt lines trim if the list isn't empty
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user