From: Steven Black Date: Fri, 25 Mar 2016 03:34:28 +0000 (-0400) Subject: Issue #77: fix bug with emitting comments. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=30e5d843d43e8fa26e28710db120ac8566691024;p=stevenblack-hosts.git Issue #77: fix bug with emitting comments. --- diff --git a/updateHostsFile.py b/updateHostsFile.py index a6133cf61..20432e09f 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -320,9 +320,7 @@ def removeDupsAndExcl(mergeFile): # replace tabs with space line = line.replace('\t+', ' ') # Trim trailing whitespace - line = line.rstrip() - if not line: - continue + line = line.rstrip() + "\n" # Testing the first character doesn't require startswith if line[0] == '#' or re.match(r'^\s*$', line[0]): # Cross-python write