summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/llnl/util/filesystem.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py
index 2478f5c159..4cf99163e0 100644
--- a/lib/spack/llnl/util/filesystem.py
+++ b/lib/spack/llnl/util/filesystem.py
@@ -93,7 +93,7 @@ def filter_file(regex, repl, *filenames, **kwargs):
try:
for line in fileinput.input(filename, inplace=True):
- print(re.sub(regex, repl, line.rstrip()))
+ print(re.sub(regex, repl, line.rstrip('\n')))
except:
# clean up the original file on failure.
shutil.move(backup_filename, filename)