From: Ben Darnell Date: Sun, 7 Oct 2018 03:55:32 +0000 (-0400) Subject: *: Remove some obsolete linter "noqa" cruft X-Git-Tag: v6.0.0b1~28^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d502a64ae4b369f737a4ee4b860b6c9aa3f7b970;p=thirdparty%2Ftornado.git *: Remove some obsolete linter "noqa" cruft --- diff --git a/tornado/concurrent.py b/tornado/concurrent.py index ee5ca40a0..3c65d9a35 100644 --- a/tornado/concurrent.py +++ b/tornado/concurrent.py @@ -44,7 +44,7 @@ class ReturnValueIgnoredError(Exception): pass -Future = asyncio.Future # noqa +Future = asyncio.Future FUTURES = (futures.Future, Future) diff --git a/tornado/gen.py b/tornado/gen.py index 27b504391..e2c77d998 100644 --- a/tornado/gen.py +++ b/tornado/gen.py @@ -784,7 +784,7 @@ class Runner(object): def inner(f: Any) -> None: # Break a reference cycle to speed GC. - f = None # noqa + f = None # noqa: F841 self.run() self.io_loop.add_future(self.future, inner) diff --git a/tornado/httputil.py b/tornado/httputil.py index e3d63857b..cb5142d54 100644 --- a/tornado/httputil.py +++ b/tornado/httputil.py @@ -57,9 +57,9 @@ from typing import ( ) if typing.TYPE_CHECKING: - from typing import Deque # noqa - from asyncio import Future # noqa - import unittest # noqa + from typing import Deque # noqa: F401 + from asyncio import Future # noqa: F401 + import unittest # noqa: F401 # RFC 7230 section 3.5: a recipient MAY recognize a single LF as a line diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 84c04fcd2..444af4e85 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -47,7 +47,7 @@ from tornado.concurrent import ( chain_future, future_set_exc_info, future_add_done_callback, -) # noqa: E501 +) from tornado.log import app_log from tornado.util import Configurable, TimeoutError, import_object diff --git a/tornado/platform/windows.py b/tornado/platform/windows.py index 82f0118cb..ddbde20cc 100644 --- a/tornado/platform/windows.py +++ b/tornado/platform/windows.py @@ -10,7 +10,7 @@ SetHandleInformation.argtypes = ( ctypes.wintypes.HANDLE, ctypes.wintypes.DWORD, ctypes.wintypes.DWORD, -) # noqa: E501 +) SetHandleInformation.restype = ctypes.wintypes.BOOL HANDLE_FLAG_INHERIT = 0x00000001 diff --git a/tornado/test/escape_test.py b/tornado/test/escape_test.py index 06c043aac..d8f95e426 100644 --- a/tornado/test/escape_test.py +++ b/tornado/test/escape_test.py @@ -15,7 +15,7 @@ from tornado.escape import ( ) from tornado.util import unicode_type -from typing import List, Tuple, Union, Dict, Any # noqa +from typing import List, Tuple, Union, Dict, Any # noqa: F401 linkify_tests = [ # (input, linkify_kwargs, expected_output) diff --git a/tornado/test/httpserver_test.py b/tornado/test/httpserver_test.py index 6f7f2a500..8a2e03a7f 100644 --- a/tornado/test/httpserver_test.py +++ b/tornado/test/httpserver_test.py @@ -16,7 +16,7 @@ from tornado.httputil import ( HTTPMessageDelegate, HTTPServerConnectionDelegate, ResponseStartLine, -) # noqa: E501 +) from tornado.iostream import IOStream from tornado.locks import Event from tornado.log import gen_log @@ -28,7 +28,7 @@ from tornado.testing import ( AsyncTestCase, ExpectLog, gen_test, -) # noqa: E501 +) from tornado.test.util import skipOnTravis from tornado.web import Application, RequestHandler, stream_request_body diff --git a/tornado/test/iostream_test.py b/tornado/test/iostream_test.py index db02ae9ee..413141a02 100644 --- a/tornado/test/iostream_test.py +++ b/tornado/test/iostream_test.py @@ -20,7 +20,7 @@ from tornado.testing import ( bind_unused_port, ExpectLog, gen_test, -) # noqa: E501 +) from tornado.test.util import skipIfNonUnix, refusing_port, skipPypy3V58 from tornado.web import RequestHandler, Application import errno diff --git a/tornado/test/routing_test.py b/tornado/test/routing_test.py index c9cb50e65..fc75d23e0 100644 --- a/tornado/test/routing_test.py +++ b/tornado/test/routing_test.py @@ -15,7 +15,7 @@ from tornado.httputil import ( HTTPMessageDelegate, HTTPServerConnectionDelegate, ResponseStartLine, -) # noqa: E501 +) from tornado.routing import ( HostMatches, PathMatches, @@ -28,7 +28,7 @@ from tornado.testing import AsyncHTTPTestCase from tornado.web import Application, HTTPError, RequestHandler from tornado.wsgi import WSGIContainer -import typing # noqa +import typing # noqa: F401 class BasicRouter(Router): diff --git a/tornado/test/runtests.py b/tornado/test/runtests.py index 9c0fffe4e..83711cc80 100644 --- a/tornado/test/runtests.py +++ b/tornado/test/runtests.py @@ -150,7 +150,7 @@ def main(): # `python3.4 -W error -c 'import asyncio; asyncio.get_event_loop()'` # would generate a warning. warnings.filterwarnings( - "ignore", category=ResourceWarning, module=r"asyncio\..*" # noqa: F821 + "ignore", category=ResourceWarning, module=r"asyncio\..*" ) logging.getLogger("tornado.access").setLevel(logging.CRITICAL) diff --git a/tornado/test/simple_httpclient_test.py b/tornado/test/simple_httpclient_test.py index cf14dce40..ed399ae05 100644 --- a/tornado/test/simple_httpclient_test.py +++ b/tornado/test/simple_httpclient_test.py @@ -30,7 +30,7 @@ from tornado.test.httpclient_test import ( CountdownHandler, HelloWorldHandler, RedirectHandler, -) # noqa: E501 +) from tornado.test import httpclient_test from tornado.testing import ( AsyncHTTPTestCase, diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index b1f707b37..87738ba3c 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -7,7 +7,7 @@ from tornado.escape import ( recursive_unicode, native_str, to_basestring, -) # noqa: E501 +) from tornado.httpclient import HTTPClientError from tornado.httputil import format_timestamp from tornado.iostream import IOStream diff --git a/tornado/test/websocket_test.py b/tornado/test/websocket_test.py index 914c7cc06..704828e3e 100644 --- a/tornado/test/websocket_test.py +++ b/tornado/test/websocket_test.py @@ -13,7 +13,7 @@ from tornado.testing import AsyncHTTPTestCase, gen_test, bind_unused_port, Expec from tornado.web import Application, RequestHandler try: - import tornado.websocket # noqa + import tornado.websocket # noqa: F401 from tornado.util import _websocket_mask_python except ImportError: # The unittest module presents misleading errors on ImportError diff --git a/tornado/util.py b/tornado/util.py index 0f21fe3c7..4d0d656a3 100644 --- a/tornado/util.py +++ b/tornado/util.py @@ -34,10 +34,10 @@ from typing import ( if typing.TYPE_CHECKING: # Additional imports only used in type comments. # This lets us make these imports lazy. - import datetime # noqa - from types import TracebackType # noqa - from typing import Union # noqa - import unittest # noqa + import datetime # noqa: F401 + from types import TracebackType # noqa: F401 + from typing import Union # noqa: F401 + import unittest # noqa: F401 # Aliases for types that are spelled differently in different Python # versions. bytes_type is deprecated and no longer used in Tornado