
python-checkins at python
Nov 18, 2009, 4:20 AM
Post #1 of 1
(88 views)
Permalink
|
|
r76362 - python/trunk/Lib/test/test_runpy.py
|
|
Author: nick.coghlan Date: Wed Nov 18 12:27:53 2009 New Revision: 76362 Log: Correctly escape arbitrary error message text in the runpy unit tests 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 Wed Nov 18 12:27:53 2009 @@ -3,6 +3,7 @@ import os import os.path import sys +import re import tempfile from test.test_support import verbose, run_unittest, forget from test.script_helper import (temp_dir, make_script, compile_script, @@ -317,8 +318,7 @@ 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("\\", "\\\\") + msg = re.escape(msg) self.assertRaisesRegexp(ImportError, msg, run_path, script_name) def test_basic_script(self): _______________________________________________ Python-checkins mailing list Python-checkins [at] python http://mail.python.org/mailman/listinfo/python-checkins
|