From: Steven Black Date: Tue, 23 Feb 2016 02:48:02 +0000 (-0500) Subject: Issue #57: fix - ignore blank lines in the whitelist. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=ffc17dd7fa544d53952dfcbc430692e6a44e6181;p=stevenblack-hosts.git Issue #57: fix - ignore blank lines in the whitelist. --- diff --git a/updateHostsFile.py b/updateHostsFile.py index 4d57bf724..5fb711228 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -261,7 +261,8 @@ def removeDupsAndExcl(mergeFile): if os.path.isfile(WHITELIST_FILE): with open(WHITELIST_FILE, "r") as ins: for line in ins: - EXCLUSIONS.append(line) + if line.rstrip(): + EXCLUSIONS.append(line) # Another mode is required to read and write the file in Python 3 finalFile = open(os.path.join(BASEDIR_PATH, 'hosts'), 'r+b')