From 5d48c108a3a3b1bbdc4821d7463f331331d941f2 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Mon, 8 Aug 2016 15:02:05 -0500 Subject: Only strip newline chars, not spaces --- lib/spack/llnl/util/filesystem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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) -- cgit v1.2.3-70-g09d2