From d4704803b95efea847cd0a9065818d771c9941fb Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Sun, 12 Jun 2016 06:07:35 +0000 Subject: =?UTF-8?q?Fix=20buggy=20RE=20=E2=80=9C\parrot=5Fexample.py?= =?UTF-8?q?=E2=80=9D,=20uncovered=20by=20Issue=20#27030?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 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) -- cgit v0.12 From 70c502aacf629bd470a88dc5f139937d62376143 Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Sun, 12 Jun 2016 06:14:03 +0000 Subject: Fix typos and English grammar in documentation and code comment --- Doc/whatsnew/2.0.rst | 2 +- Lib/test/test_coroutines.py | 2 +- Misc/NEWS | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/whatsnew/2.0.rst b/Doc/whatsnew/2.0.rst index 87462f3..4d49af1 100644 --- a/Doc/whatsnew/2.0.rst +++ b/Doc/whatsnew/2.0.rst @@ -506,7 +506,7 @@ arguments and/or a dictionary of keyword arguments. In Python 1.5 and earlier, you'd use the :func:`apply` built-in function: ``apply(f, args, kw)`` calls the function :func:`f` with the argument tuple *args* and the keyword arguments in the dictionary *kw*. :func:`apply` is the same in 2.0, but thanks to a patch -from Greg Ewing, ``f(*args, **kw)`` as a shorter and clearer way to achieve the +from Greg Ewing, ``f(*args, **kw)`` is a shorter and clearer way to achieve the same effect. This syntax is symmetrical with the syntax for defining functions:: diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index 4f725ae..d0cefb0 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -1423,7 +1423,7 @@ class CoroutineTest(unittest.TestCase): with warnings.catch_warnings(): warnings.simplefilter("error") - # Test that __aiter__ that returns an asyncronous iterator + # Test that __aiter__ that returns an asynchronous iterator # directly does not throw any warnings. run_async(main()) self.assertEqual(I, 111011) diff --git a/Misc/NEWS b/Misc/NEWS index 8a39c08..ddcde75 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -2215,8 +2215,8 @@ Library writer failed in BufferedRWPair.close(). - Issue #23622: Unknown escapes in regular expressions that consist of ``'\'`` - and ASCII letter now raise a deprecation warning and will be forbidden in - Python 3.6. + and an ASCII letter now raise a deprecation warning and will be forbidden + in Python 3.6. - Issue #23671: string.Template now allows specifying the "self" parameter as a keyword argument. string.Formatter now allows specifying the "self" and -- cgit v0.12