Escape path names to fix regular expression matches on Windows
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 20 Jan 2009 14:46:23 +0000 (14:46 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 20 Jan 2009 14:46:23 +0000 (14:46 +0000)
when \ is the path separator.

git-svn-id: http://scons.tigris.org/svn/scons/trunk@3912 fdb21ef1-2011-0410-befe-b5e4ea1792b1

test/Configure/build-fail.py

index 2facb810c8aa7b464e62b3399e831bc95faf3264..4e63f83ab9d127be4b86224353998034477089e3 100644 (file)
@@ -37,6 +37,7 @@ Thanks to Ben Webb for the test case.
 """
 
 import os
+import re
 
 import TestSCons
 
@@ -73,12 +74,12 @@ conf.Finish()
 
 test.write(['b', 'boost.hpp'], """#define FILE "b/boost.hpp"\n""")
 
-expect = test.wrap_stdout(read_str = "%s: yes\n" % b_boost_hpp,
+expect = test.wrap_stdout(read_str = "%s: yes\n" % re.escape(b_boost_hpp),
                           build_str = "scons: `.' is up to date.\n")
 
 test.run(arguments='--config=force', stdout=expect)
 
-expect = test.wrap_stdout(read_str = "%s: yes\n" % a_boost_hpp,
+expect = test.wrap_stdout(read_str = "%s: yes\n" % re.escape(a_boost_hpp),
                           build_str = "scons: `.' is up to date.\n")
 
 test.write(['a', 'boost.hpp'], """#define FILE "a/boost.hpp"\n""")