[Python-checkins] cpython (3.5): Fix buggy RE “\parrot_example.py”, uncovered by Issue #27030
martin.panter
python-checkins at python.org
Sun Jun 12 02:28:42 EDT 2016
https://hg.python.org/cpython/rev/a2482e805dff
changeset: 101917:a2482e805dff
branch: 3.5
parent: 101913:d84268ed62ac
user: Martin Panter <vadmium+py at gmail.com>
date: Sun Jun 12 06:07:35 2016 +0000
summary:
Fix buggy RE “\parrot_example.py”, uncovered by Issue #27030
files:
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
--- a/Lib/lib2to3/tests/test_refactor.py
+++ b/Lib/lib2to3/tests/test_refactor.py
@@ -9,6 +9,7 @@
import codecs
import operator
import io
+import re
import tempfile
import shutil
import unittest
@@ -226,8 +227,8 @@
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)
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list