diff options
author | Gregory P. Smith <greg@krypto.org> | 2012-02-14 00:38:37 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2012-02-14 00:38:37 (GMT) |
commit | 9903c705b89c197c96e8286c9351a31b9c23fd44 (patch) | |
tree | 1180d522cbbcbd4aee346156936e152da3fcadff /Lib/lib2to3 | |
parent | 93b98ca44572ad606ced420ffe9376fa06f93c4e (diff) | |
download | cpython-9903c705b89c197c96e8286c9351a31b9c23fd44.zip cpython-9903c705b89c197c96e8286c9351a31b9c23fd44.tar.gz cpython-9903c705b89c197c96e8286c9351a31b9c23fd44.tar.bz2 |
re.escape os.sep so that \ is interpreted properly in the regex.
Diffstat (limited to 'Lib/lib2to3')
-rw-r--r-- | Lib/lib2to3/tests/test_main.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/lib2to3/tests/test_main.py b/Lib/lib2to3/tests/test_main.py index 225c15d..86cb438 100644 --- a/Lib/lib2to3/tests/test_main.py +++ b/Lib/lib2to3/tests/test_main.py @@ -94,10 +94,11 @@ class TestMain(unittest.TestCase): self.assertIn("Writing converted %s to %s" % ( os.path.join(self.py2_src_dir, name), os.path.join(self.py3_dest_dir, name+suffix)), stderr) + sep = re.escape(os.sep) self.assertRegex( - stderr, r"No changes to .*/__init__\.py".replace("/", os.sep)) + stderr, r"No changes to .*/__init__\.py".replace("/", sep)) self.assertNotRegex( - stderr, r"No changes to .*/trivial\.py".replace("/", os.sep)) + stderr, r"No changes to .*/trivial\.py".replace("/", sep)) def test_filename_changing_on_output_two_files(self): """2to3 two files in one directory with a new output dir.""" |