diff options
author | Gregory P. Smith <greg@krypto.org> | 2012-02-14 00:45:47 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2012-02-14 00:45:47 (GMT) |
commit | e1dbbbfc514dec56e6cf695cb7f127a4782ec6b7 (patch) | |
tree | 4de4291f820516743c0c51c4f7d0b42a50d7303f /Lib | |
parent | d9c2df868f827ca9c72ee28f7a1a6619275863ee (diff) | |
download | cpython-e1dbbbfc514dec56e6cf695cb7f127a4782ec6b7.zip cpython-e1dbbbfc514dec56e6cf695cb7f127a4782ec6b7.tar.gz cpython-e1dbbbfc514dec56e6cf695cb7f127a4782ec6b7.tar.bz2 |
re.escape os.sep so that \ is interpreted properly in the regex.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/lib2to3/tests/test_main.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/lib2to3/tests/test_main.py b/Lib/lib2to3/tests/test_main.py index 455d8a7..7f8b25c 100644 --- a/Lib/lib2to3/tests/test_main.py +++ b/Lib/lib2to3/tests/test_main.py @@ -3,6 +3,7 @@ import sys import codecs import logging import os +import re import shutil import StringIO import sys @@ -104,10 +105,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.assertRegexpMatches( - 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.""" |