From 0a1581c11b158006233251aa9312b2e9101275b5 Mon Sep 17 00:00:00 2001 From: Pierce Lopez Date: Sun, 10 Feb 2019 22:13:44 -0500 Subject: [PATCH] new flake8 warning fixes for 5.1 branch due to flake8 / pyflakes / pycodestyle updates --- .flake8 | 2 ++ tornado/test/web_test.py | 2 +- tornado/util.py | 4 ++-- tornado/web.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.flake8 b/.flake8 index 1c2c768d..803d06d2 100644 --- a/.flake8 +++ b/.flake8 @@ -10,4 +10,6 @@ ignore = E402, # E722 do not use bare except E722, + # W504 line break after binary operator + W504, doctests = true diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index 16938c42..b1ae4747 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -398,7 +398,7 @@ class AuthRedirectTest(WebTestCase): follow_redirects=False) self.assertEqual(response.code, 302) self.assertTrue(re.match( - 'http://example.com/login\?next=http%3A%2F%2F127.0.0.1%3A[0-9]+%2Fabsolute', + r'http://example.com/login\?next=http%3A%2F%2F127.0.0.1%3A[0-9]+%2Fabsolute', response.headers['Location']), response.headers['Location']) diff --git a/tornado/util.py b/tornado/util.py index a42ebebe..151b0d88 100644 --- a/tornado/util.py +++ b/tornado/util.py @@ -59,7 +59,7 @@ else: import datetime # noqa import types # noqa from typing import Any, AnyStr, Union, Optional, Dict, Mapping # noqa - from typing import Tuple, Match, Callable # noqa + from typing import List, Tuple, Match, Callable # noqa if PY3: _BaseString = str @@ -252,7 +252,7 @@ _re_unescape_pattern = re.compile(r'\\(.)', re.DOTALL) def re_unescape(s): # type: (str) -> str - """Unescape a string escaped by `re.escape`. + r"""Unescape a string escaped by `re.escape`. May raise ``ValueError`` for regular expressions which could not have been produced by `re.escape` (for example, strings containing diff --git a/tornado/web.py b/tornado/web.py index 6760b0b9..4340b16f 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -1887,7 +1887,7 @@ class _ApplicationRouter(ReversibleRuleRouter): class Application(ReversibleRouter): - """A collection of request handlers that make up a web application. + r"""A collection of request handlers that make up a web application. Instances of this class are callable and can be passed directly to HTTPServer to serve the application::