From 93f815a50cc00e20a411491894307f695e000974 Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Sun, 12 Jun 2016 06:07:35 +0000 Subject: [PATCH] =?utf8?q?Fix=20buggy=20RE=20=E2=80=9C\parrot=5Fexample.py?= =?utf8?q?=E2=80=9D,=20uncovered=20by=20Issue=20#27030?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Lib/lib2to3/tests/test_refactor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Lib/lib2to3/tests/test_refactor.py b/Lib/lib2to3/tests/test_refactor.py index 7fc84e2530..c737aa5f4e 100644 --- a/Lib/lib2to3/tests/test_refactor.py +++ b/Lib/lib2to3/tests/test_refactor.py @@ -8,6 +8,7 @@ import sys import os import codecs import operator +import re import StringIO import tempfile import shutil @@ -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.assertRegexpMatches(message, message_regex) -- 2.50.1