diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-06-12 06:07:35 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-06-12 06:07:35 (GMT) |
commit | d4704803b95efea847cd0a9065818d771c9941fb (patch) | |
tree | 65872d1b5f9e756c09201311a9302dfdd7363eec /Lib | |
parent | 4f8aaf644095fef61ba1104af0f07efe2a099079 (diff) | |
download | cpython-d4704803b95efea847cd0a9065818d771c9941fb.zip cpython-d4704803b95efea847cd0a9065818d771c9941fb.tar.gz cpython-d4704803b95efea847cd0a9065818d771c9941fb.tar.bz2 |
Fix buggy RE “\parrot_example.py”, uncovered by Issue #27030
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/lib2to3/tests/test_refactor.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/lib2to3/tests/test_refactor.py b/Lib/lib2to3/tests/test_refactor.py index f30c1e8..8563001 100644 --- a/Lib/lib2to3/tests/test_refactor.py +++ b/Lib/lib2to3/tests/test_refactor.py @@ -9,6 +9,7 @@ import os import codecs import operator import io +import re import tempfile import shutil import unittest @@ -226,8 +227,8 @@ from __future__ import print_function""" actually_write=False) # Testing that it logged this message when write=False was passed is # sufficient to see that it did not bail early after "No changes". - message_regex = r"Not writing changes to .*%s%s" % ( - os.sep, os.path.basename(test_file)) + message_regex = r"Not writing changes to .*%s" % \ + re.escape(os.sep + os.path.basename(test_file)) for message in debug_messages: if "Not writing changes" in message: self.assertRegex(message, message_regex) |