[Python-checkins] r76322 - python/trunk/Lib/test/test_runpy.py

nick.coghlan python-checkins at python.org
Mon Nov 16 04:57:32 CET 2009


Author: nick.coghlan
Date: Mon Nov 16 04:57:32 2009
New Revision: 76322

Log:
Allow for backslashes in file paths passed to the regex engine

Modified:
   python/trunk/Lib/test/test_runpy.py

Modified: python/trunk/Lib/test/test_runpy.py
==============================================================================
--- python/trunk/Lib/test/test_runpy.py	(original)
+++ python/trunk/Lib/test/test_runpy.py	Mon Nov 16 04:57:32 2009
@@ -317,6 +317,8 @@
         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):


More information about the Python-checkins mailing list