Allow for backslashes in file paths passed to the regex engine

This commit is contained in:
Nick Coghlan 2009-11-16 03:57:32 +00:00
parent 4976e3287a
commit 4b953bac94
1 changed files with 2 additions and 0 deletions

View File

@ -317,6 +317,8 @@ argv0 = sys.argv[0]
self.assertEqual(result["__package__"], expected_package) self.assertEqual(result["__package__"], expected_package)
def _check_import_error(self, script_name, msg): 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) self.assertRaisesRegexp(ImportError, msg, run_path, script_name)
def test_basic_script(self): def test_basic_script(self):