diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2009-11-18 11:35:25 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2009-11-18 11:35:25 (GMT) |
commit | 16eb0fbbd015de7b0116d984a08df8d05ef90e17 (patch) | |
tree | 4257e7bd5a01c353e9fec3bea0a594b9afc72a56 /Lib/test/test_runpy.py | |
parent | 11c9d251ef12b8f8fdd787d0d053d292c2787ae8 (diff) | |
download | cpython-16eb0fbbd015de7b0116d984a08df8d05ef90e17.zip cpython-16eb0fbbd015de7b0116d984a08df8d05ef90e17.tar.gz cpython-16eb0fbbd015de7b0116d984a08df8d05ef90e17.tar.bz2 |
Merged revisions 76362 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76362 | nick.coghlan | 2009-11-18 21:27:53 +1000 (Wed, 18 Nov 2009) | 1 line
Correctly escape arbitrary error message text in the runpy unit tests
........
Diffstat (limited to 'Lib/test/test_runpy.py')
-rw-r--r-- | Lib/test/test_runpy.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_runpy.py b/Lib/test/test_runpy.py index bd22814..88e05fe 100644 --- a/Lib/test/test_runpy.py +++ b/Lib/test/test_runpy.py @@ -3,6 +3,7 @@ import unittest import os import os.path import sys +import re import tempfile from test.support import verbose, run_unittest, forget from test.script_helper import (temp_dir, make_script, compile_script, @@ -290,8 +291,7 @@ 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("\\", "\\\\") + msg = re.escape(msg) self.assertRaisesRegexp(ImportError, msg, run_path, script_name) def test_basic_script(self): |