Issue #27030: Merge RE fix from 3.5

This commit is contained in:
Martin Panter 2016-06-12 06:08:29 +00:00
commit 50d4c15ba7
1 changed files with 3 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import sys
import os
import codecs
import io
import re
import tempfile
import shutil
import unittest
@ -222,8 +223,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)