From 30e5d843d43e8fa26e28710db120ac8566691024 Mon Sep 17 00:00:00 2001 From: Steven Black Date: Thu, 24 Mar 2016 23:34:28 -0400 Subject: [PATCH] Issue #77: fix bug with emitting comments. --- updateHostsFile.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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