]> granicus.if.org Git - python/commitdiff
Allow for backslashes in file paths passed to the regex engine
authorNick Coghlan <ncoghlan@gmail.com>
Mon, 16 Nov 2009 03:57:32 +0000 (03:57 +0000)
committerNick Coghlan <ncoghlan@gmail.com>
Mon, 16 Nov 2009 03:57:32 +0000 (03:57 +0000)
Lib/test/test_runpy.py

index 510bf1e7acffb70b1db3709fb056c09d1c9d52f4..45c839e87b395c28f20e4069bc336fecebc9e80c 100644 (file)
@@ -317,6 +317,8 @@ argv0 = sys.argv[0]
         self.assertEqual(result["__package__"], expected_package)
 
     def _check_import_error(self, script_name, msg):
+        # Double backslashes to handle path separators on Windows
+        msg = msg.replace("\\", "\\\\")
         self.assertRaisesRegexp(ImportError, msg, run_path, script_name)
 
     def test_basic_script(self):