From e332a7de7e340a868e96cb1fdb82ab6565d48a77 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sat, 14 Jul 2018 11:46:28 -0400 Subject: [PATCH] *: Remove Python2 __future__ imports throughout the codebase --- demos/file_upload/file_uploader.py | 1 - demos/tcpecho/client.py | 1 - maint/circlerefs/circlerefs.py | 1 - maint/scripts/test_resolvers.py | 2 -- maint/vm/windows/bootstrap.py | 1 - tornado/__init__.py | 2 -- tornado/_locale_data.py | 2 -- tornado/auth.py | 2 -- tornado/autoreload.py | 2 -- tornado/concurrent.py | 1 - tornado/curl_httpclient.py | 2 -- tornado/escape.py | 2 -- tornado/gen.py | 2 -- tornado/http1connection.py | 2 -- tornado/httpclient.py | 2 -- tornado/httpserver.py | 2 -- tornado/httputil.py | 2 -- tornado/ioloop.py | 2 -- tornado/iostream.py | 2 -- tornado/locale.py | 2 -- tornado/locks.py | 2 -- tornado/log.py | 2 -- tornado/netutil.py | 2 -- tornado/options.py | 2 -- tornado/platform/asyncio.py | 1 - tornado/platform/auto.py | 2 -- tornado/platform/caresresolver.py | 1 - tornado/platform/interface.py | 2 -- tornado/platform/posix.py | 2 -- tornado/platform/twisted.py | 2 -- tornado/platform/windows.py | 2 -- tornado/process.py | 2 -- tornado/queues.py | 2 -- tornado/routing.py | 2 -- tornado/simple_httpclient.py | 2 -- tornado/tcpclient.py | 1 - tornado/tcpserver.py | 1 - tornado/template.py | 2 -- tornado/test/__main__.py | 2 -- tornado/test/asyncio_test.py | 2 -- tornado/test/auth_test.py | 3 --- tornado/test/autoreload_test.py | 1 - tornado/test/concurrent_test.py | 2 -- tornado/test/curl_httpclient_test.py | 2 -- tornado/test/escape_test.py | 2 -- tornado/test/gen_test.py | 2 -- tornado/test/gettext_translations/extract_me.py | 1 - tornado/test/http1connection_test.py | 2 -- tornado/test/httpclient_test.py | 2 -- tornado/test/httpserver_test.py | 2 -- tornado/test/httputil_test.py | 2 -- tornado/test/import_test.py | 2 -- tornado/test/ioloop_test.py | 2 -- tornado/test/iostream_test.py | 1 - tornado/test/locale_test.py | 2 -- tornado/test/locks_test.py | 2 -- tornado/test/log_test.py | 2 -- tornado/test/netutil_test.py | 2 -- tornado/test/options_test.py | 2 -- tornado/test/process_test.py | 2 -- tornado/test/queues_test.py | 2 -- tornado/test/resolve_test_helper.py | 1 - tornado/test/routing_test.py | 3 --- tornado/test/runtests.py | 2 -- tornado/test/simple_httpclient_test.py | 2 -- tornado/test/tcpclient_test.py | 3 --- tornado/test/tcpserver_test.py | 5 ----- tornado/test/template_test.py | 10 +++++----- tornado/test/testing_test.py | 2 -- tornado/test/twisted_test.py | 2 -- tornado/test/util.py | 2 -- tornado/test/util_test.py | 8 +++----- tornado/test/web_test.py | 2 -- tornado/test/websocket_test.py | 2 -- tornado/test/windows_test.py | 1 - tornado/test/wsgi_test.py | 1 - tornado/testing.py | 2 -- tornado/util.py | 2 -- tornado/web.py | 2 -- tornado/websocket.py | 2 -- tornado/wsgi.py | 2 -- 81 files changed, 8 insertions(+), 159 deletions(-) diff --git a/demos/file_upload/file_uploader.py b/demos/file_upload/file_uploader.py index 9f1f84d516..179eb248e7 100755 --- a/demos/file_upload/file_uploader.py +++ b/demos/file_upload/file_uploader.py @@ -9,7 +9,6 @@ See also file_receiver.py in this directory, a server that receives uploads. """ -from __future__ import print_function import mimetypes import os import sys diff --git a/demos/tcpecho/client.py b/demos/tcpecho/client.py index 51d3a8d5f2..a2ead08bc8 100755 --- a/demos/tcpecho/client.py +++ b/demos/tcpecho/client.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -from __future__ import print_function from tornado.ioloop import IOLoop from tornado import gen from tornado.tcpclient import TCPClient diff --git a/maint/circlerefs/circlerefs.py b/maint/circlerefs/circlerefs.py index 5cc4e1f6de..bd8214aa82 100755 --- a/maint/circlerefs/circlerefs.py +++ b/maint/circlerefs/circlerefs.py @@ -7,7 +7,6 @@ increases memory footprint and CPU overhead, so we try to eliminate circular references created by normal operation. """ -from __future__ import print_function import gc import traceback diff --git a/maint/scripts/test_resolvers.py b/maint/scripts/test_resolvers.py index 2a466c1ac9..82dec30e66 100755 --- a/maint/scripts/test_resolvers.py +++ b/maint/scripts/test_resolvers.py @@ -1,6 +1,4 @@ #!/usr/bin/env python -from __future__ import print_function - import pprint import socket diff --git a/maint/vm/windows/bootstrap.py b/maint/vm/windows/bootstrap.py index 281bf573cf..9bfb5c7230 100755 --- a/maint/vm/windows/bootstrap.py +++ b/maint/vm/windows/bootstrap.py @@ -21,7 +21,6 @@ To run under cygwin (which must be installed separately), run cd /cygdrive/e; python -m tornado.test.runtests """ -from __future__ import absolute_import, division, print_function import os import subprocess diff --git a/tornado/__init__.py b/tornado/__init__.py index ae8fd99878..e6c4505930 100644 --- a/tornado/__init__.py +++ b/tornado/__init__.py @@ -15,8 +15,6 @@ """The Tornado web server and tools.""" -from __future__ import absolute_import, division, print_function - # version is a human-readable version number. # version_info is a four-tuple for programmatic comparison. The first diff --git a/tornado/_locale_data.py b/tornado/_locale_data.py index a2c503907d..91416d9b45 100644 --- a/tornado/_locale_data.py +++ b/tornado/_locale_data.py @@ -16,8 +16,6 @@ """Data used by the tornado.locale module.""" -from __future__ import absolute_import, division, print_function - LOCALE_NAMES = { "af_ZA": {"name_en": u"Afrikaans", "name": u"Afrikaans"}, "am_ET": {"name_en": u"Amharic", "name": u"አማርኛ"}, diff --git a/tornado/auth.py b/tornado/auth.py index a3fd7943c5..35d5ee203f 100644 --- a/tornado/auth.py +++ b/tornado/auth.py @@ -56,8 +56,6 @@ async def get(self): """ -from __future__ import absolute_import, division, print_function - import base64 import binascii import hashlib diff --git a/tornado/autoreload.py b/tornado/autoreload.py index 9c5b2326bc..01951fccf2 100644 --- a/tornado/autoreload.py +++ b/tornado/autoreload.py @@ -43,8 +43,6 @@ """ -from __future__ import absolute_import, division, print_function - import os import sys diff --git a/tornado/concurrent.py b/tornado/concurrent.py index 37d58e8653..7c2679dd2c 100644 --- a/tornado/concurrent.py +++ b/tornado/concurrent.py @@ -26,7 +26,6 @@ implementation, applications rarely need to interact with it directly. """ -from __future__ import absolute_import, division, print_function import asyncio from concurrent import futures diff --git a/tornado/curl_httpclient.py b/tornado/curl_httpclient.py index b412897f6e..13e1f136c9 100644 --- a/tornado/curl_httpclient.py +++ b/tornado/curl_httpclient.py @@ -15,8 +15,6 @@ """Non-blocking HTTP client implementation using pycurl.""" -from __future__ import absolute_import, division, print_function - import collections import functools import logging diff --git a/tornado/escape.py b/tornado/escape.py index 6ca81584e0..382133f5b5 100644 --- a/tornado/escape.py +++ b/tornado/escape.py @@ -19,8 +19,6 @@ have crept in over time. """ -from __future__ import absolute_import, division, print_function - import html.entities import json import re diff --git a/tornado/gen.py b/tornado/gen.py index e5ff49832b..982cb8dfc6 100644 --- a/tornado/gen.py +++ b/tornado/gen.py @@ -70,8 +70,6 @@ def get(self): via ``singledispatch``. """ -from __future__ import absolute_import, division, print_function - import asyncio import builtins import collections diff --git a/tornado/http1connection.py b/tornado/http1connection.py index fba9cb9bf9..0002f857b5 100644 --- a/tornado/http1connection.py +++ b/tornado/http1connection.py @@ -18,8 +18,6 @@ .. versionadded:: 4.0 """ -from __future__ import absolute_import, division, print_function - import re from tornado.concurrent import (Future, future_add_done_callback, diff --git a/tornado/httpclient.py b/tornado/httpclient.py index 7c2f2568a6..d3a42cd378 100644 --- a/tornado/httpclient.py +++ b/tornado/httpclient.py @@ -38,8 +38,6 @@ AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient") """ -from __future__ import absolute_import, division, print_function - import functools import time import weakref diff --git a/tornado/httpserver.py b/tornado/httpserver.py index 3498d71fb6..0269b045eb 100644 --- a/tornado/httpserver.py +++ b/tornado/httpserver.py @@ -25,8 +25,6 @@ class except to start a server at the beginning of the process to `tornado.httputil.HTTPServerRequest`. The old name remains as an alias. """ -from __future__ import absolute_import, division, print_function - import socket from tornado.escape import native_str diff --git a/tornado/httputil.py b/tornado/httputil.py index 48c545ed57..0e498235b0 100644 --- a/tornado/httputil.py +++ b/tornado/httputil.py @@ -19,8 +19,6 @@ via `tornado.web.RequestHandler.request`. """ -from __future__ import absolute_import, division, print_function - import calendar import collections import copy diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 2f9319f7b2..51dbe45401 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -30,8 +30,6 @@ """ -from __future__ import absolute_import, division, print_function - import asyncio from concurrent.futures import ThreadPoolExecutor import datetime diff --git a/tornado/iostream.py b/tornado/iostream.py index da6817349b..ba8284f3f1 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -23,8 +23,6 @@ * `PipeIOStream`: Pipe-based IOStream implementation. """ -from __future__ import absolute_import, division, print_function - import collections import errno import io diff --git a/tornado/locale.py b/tornado/locale.py index 2931010ced..9247bcb528 100644 --- a/tornado/locale.py +++ b/tornado/locale.py @@ -39,8 +39,6 @@ the `Locale.translate` method will simply return the original string. """ -from __future__ import absolute_import, division, print_function - import codecs import csv import datetime diff --git a/tornado/locks.py b/tornado/locks.py index 9566a4573c..15b8f4d870 100644 --- a/tornado/locks.py +++ b/tornado/locks.py @@ -12,8 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import, division, print_function - import collections from concurrent.futures import CancelledError diff --git a/tornado/log.py b/tornado/log.py index cda905c9ba..c0171ba166 100644 --- a/tornado/log.py +++ b/tornado/log.py @@ -27,8 +27,6 @@ `logging` module. For example, you may wish to send ``tornado.access`` logs to a separate file for analysis. """ -from __future__ import absolute_import, division, print_function - import logging import logging.handlers import sys diff --git a/tornado/netutil.py b/tornado/netutil.py index c7682be3a8..c57f6fd347 100644 --- a/tornado/netutil.py +++ b/tornado/netutil.py @@ -15,8 +15,6 @@ """Miscellaneous network utility code.""" -from __future__ import absolute_import, division, print_function - import errno import os import sys diff --git a/tornado/options.py b/tornado/options.py index f3b87199b9..f2d30a6e88 100644 --- a/tornado/options.py +++ b/tornado/options.py @@ -93,8 +93,6 @@ def start_server(): underscores. """ -from __future__ import absolute_import, division, print_function - import datetime import numbers import re diff --git a/tornado/platform/asyncio.py b/tornado/platform/asyncio.py index 04254bed3e..b139c90029 100644 --- a/tornado/platform/asyncio.py +++ b/tornado/platform/asyncio.py @@ -19,7 +19,6 @@ Windows. Use the `~asyncio.SelectorEventLoop` instead. """ -from __future__ import absolute_import, division, print_function import functools from tornado.gen import convert_yielded diff --git a/tornado/platform/auto.py b/tornado/platform/auto.py index 16ee9091a5..6c3100170f 100644 --- a/tornado/platform/auto.py +++ b/tornado/platform/auto.py @@ -22,8 +22,6 @@ from tornado.platform.auto import set_close_exec """ -from __future__ import absolute_import, division, print_function - import os if os.name == 'nt': diff --git a/tornado/platform/caresresolver.py b/tornado/platform/caresresolver.py index 768cb62499..f1e379b229 100644 --- a/tornado/platform/caresresolver.py +++ b/tornado/platform/caresresolver.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, division, print_function import pycares # type: ignore import socket diff --git a/tornado/platform/interface.py b/tornado/platform/interface.py index c2d54e4ce8..d7a6d76ee4 100644 --- a/tornado/platform/interface.py +++ b/tornado/platform/interface.py @@ -20,8 +20,6 @@ implementation from `tornado.platform.auto`. """ -from __future__ import absolute_import, division, print_function - def set_close_exec(fd): """Sets the close-on-exec bit (``FD_CLOEXEC``)for a file descriptor.""" diff --git a/tornado/platform/posix.py b/tornado/platform/posix.py index c8571e6b09..54327746c6 100644 --- a/tornado/platform/posix.py +++ b/tornado/platform/posix.py @@ -15,8 +15,6 @@ """Posix implementations of platform-specific functionality.""" -from __future__ import absolute_import, division, print_function - import fcntl import os diff --git a/tornado/platform/twisted.py b/tornado/platform/twisted.py index a5f41ab6bf..68646b300f 100644 --- a/tornado/platform/twisted.py +++ b/tornado/platform/twisted.py @@ -21,8 +21,6 @@ This module has been tested with Twisted versions 11.0.0 and newer. """ -from __future__ import absolute_import, division, print_function - import socket import sys diff --git a/tornado/platform/windows.py b/tornado/platform/windows.py index 4127700659..274937f867 100644 --- a/tornado/platform/windows.py +++ b/tornado/platform/windows.py @@ -1,8 +1,6 @@ # NOTE: win32 support is currently experimental, and not recommended # for production use. - -from __future__ import absolute_import, division, print_function import ctypes # type: ignore import ctypes.wintypes # type: ignore diff --git a/tornado/process.py b/tornado/process.py index 7a5fbaed0b..8f8dd3e074 100644 --- a/tornado/process.py +++ b/tornado/process.py @@ -17,8 +17,6 @@ the server into multiple processes and managing subprocesses. """ -from __future__ import absolute_import, division, print_function - import errno import os import multiprocessing diff --git a/tornado/queues.py b/tornado/queues.py index 7cb96bfcc7..bc33384477 100644 --- a/tornado/queues.py +++ b/tornado/queues.py @@ -25,8 +25,6 @@ """ -from __future__ import absolute_import, division, print_function - import collections import heapq diff --git a/tornado/routing.py b/tornado/routing.py index e56d1a75f9..8122faf5b9 100644 --- a/tornado/routing.py +++ b/tornado/routing.py @@ -175,8 +175,6 @@ def request_callable(request): """ -from __future__ import absolute_import, division, print_function - import re from functools import partial diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py index bf41abbf1d..d0df55271b 100644 --- a/tornado/simple_httpclient.py +++ b/tornado/simple_httpclient.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - from tornado.escape import _unicode from tornado import gen from tornado.httpclient import HTTPResponse, HTTPError, AsyncHTTPClient, main, _RequestProxy diff --git a/tornado/tcpclient.py b/tornado/tcpclient.py index e726f51069..94dcdf1506 100644 --- a/tornado/tcpclient.py +++ b/tornado/tcpclient.py @@ -15,7 +15,6 @@ """A non-blocking TCP connection factory. """ -from __future__ import absolute_import, division, print_function import functools import socket diff --git a/tornado/tcpserver.py b/tornado/tcpserver.py index 31e16b8df3..038d8223cd 100644 --- a/tornado/tcpserver.py +++ b/tornado/tcpserver.py @@ -14,7 +14,6 @@ # under the License. """A non-blocking, single-threaded TCP server.""" -from __future__ import absolute_import, division, print_function import errno import os diff --git a/tornado/template.py b/tornado/template.py index 382f08f405..ac5dcf8885 100644 --- a/tornado/template.py +++ b/tornado/template.py @@ -195,8 +195,6 @@ class (and specifically its ``render`` method) and will not work `filter_whitespace` for available options. New in Tornado 4.3. """ -from __future__ import absolute_import, division, print_function - import datetime from io import StringIO import linecache diff --git a/tornado/test/__main__.py b/tornado/test/__main__.py index c78478cbd3..430c895fa2 100644 --- a/tornado/test/__main__.py +++ b/tornado/test/__main__.py @@ -2,8 +2,6 @@ This only works in python 2.7+. """ -from __future__ import absolute_import, division, print_function - from tornado.test.runtests import all, main # tornado.testing.main autodiscovery relies on 'all' being present in diff --git a/tornado/test/asyncio_test.py b/tornado/test/asyncio_test.py index 23073090d8..990ecc9064 100644 --- a/tornado/test/asyncio_test.py +++ b/tornado/test/asyncio_test.py @@ -10,8 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import, division, print_function - import asyncio import unittest diff --git a/tornado/test/auth_test.py b/tornado/test/auth_test.py index ee5ee7a7b6..eba46a6d4a 100644 --- a/tornado/test/auth_test.py +++ b/tornado/test/auth_test.py @@ -3,9 +3,6 @@ # and ensure that it doesn't blow up (e.g. with unicode/bytes issues in # python 3) - -from __future__ import absolute_import, division, print_function - from tornado.auth import ( OpenIdMixin, OAuthMixin, OAuth2Mixin, GoogleOAuth2Mixin, FacebookGraphMixin, TwitterMixin, diff --git a/tornado/test/autoreload_test.py b/tornado/test/autoreload_test.py index bac17fa66d..6c62b3308a 100644 --- a/tornado/test/autoreload_test.py +++ b/tornado/test/autoreload_test.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, division, print_function import os import shutil import subprocess diff --git a/tornado/test/concurrent_test.py b/tornado/test/concurrent_test.py index 444529f8c2..9dbccbeee9 100644 --- a/tornado/test/concurrent_test.py +++ b/tornado/test/concurrent_test.py @@ -12,8 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import, division, print_function - from concurrent import futures import logging import re diff --git a/tornado/test/curl_httpclient_test.py b/tornado/test/curl_httpclient_test.py index 4d371adff3..b93e97123f 100644 --- a/tornado/test/curl_httpclient_test.py +++ b/tornado/test/curl_httpclient_test.py @@ -1,6 +1,4 @@ # coding: utf-8 -from __future__ import absolute_import, division, print_function - from hashlib import md5 import unittest diff --git a/tornado/test/escape_test.py b/tornado/test/escape_test.py index a7f0491b81..6881850dde 100644 --- a/tornado/test/escape_test.py +++ b/tornado/test/escape_test.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import unittest import tornado.escape diff --git a/tornado/test/gen_test.py b/tornado/test/gen_test.py index d3881a9b84..9e6cb095eb 100644 --- a/tornado/test/gen_test.py +++ b/tornado/test/gen_test.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import asyncio from concurrent import futures import gc diff --git a/tornado/test/gettext_translations/extract_me.py b/tornado/test/gettext_translations/extract_me.py index 283c13f413..08b29bc53c 100644 --- a/tornado/test/gettext_translations/extract_me.py +++ b/tornado/test/gettext_translations/extract_me.py @@ -8,7 +8,6 @@ # 3) msgfmt tornado_test.po -o tornado_test.mo # 4) Put the file in the proper location: $LANG/LC_MESSAGES -from __future__ import absolute_import, division, print_function _("school") pgettext("law", "right") pgettext("good", "right") diff --git a/tornado/test/http1connection_test.py b/tornado/test/http1connection_test.py index 8aaaaf35b7..4d8c04bc51 100644 --- a/tornado/test/http1connection_test.py +++ b/tornado/test/http1connection_test.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import socket from tornado.http1connection import HTTP1Connection diff --git a/tornado/test/httpclient_test.py b/tornado/test/httpclient_test.py index a9212e89fa..578f1f39da 100644 --- a/tornado/test/httpclient_test.py +++ b/tornado/test/httpclient_test.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, division, print_function - import base64 import binascii from contextlib import closing diff --git a/tornado/test/httpserver_test.py b/tornado/test/httpserver_test.py index 6f4389abf8..3b1e23470d 100644 --- a/tornado/test/httpserver_test.py +++ b/tornado/test/httpserver_test.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - from tornado import gen, netutil from tornado.concurrent import Future from tornado.escape import json_decode, json_encode, utf8, _unicode, recursive_unicode, native_str diff --git a/tornado/test/httputil_test.py b/tornado/test/httputil_test.py index b1fb468d96..cec6017fed 100644 --- a/tornado/test/httputil_test.py +++ b/tornado/test/httputil_test.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, division, print_function - from tornado.httputil import ( url_concat, parse_multipart_form_data, HTTPHeaders, format_timestamp, HTTPServerRequest, parse_request_start_line, parse_cookie, qs_to_qsl, diff --git a/tornado/test/import_test.py b/tornado/test/import_test.py index be5b312364..2f360d082c 100644 --- a/tornado/test/import_test.py +++ b/tornado/test/import_test.py @@ -1,6 +1,4 @@ # flake8: noqa -from __future__ import absolute_import, division, print_function - import subprocess import sys import unittest diff --git a/tornado/test/ioloop_test.py b/tornado/test/ioloop_test.py index 6f886cca78..fc0011cf4b 100644 --- a/tornado/test/ioloop_test.py +++ b/tornado/test/ioloop_test.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - from concurrent.futures import ThreadPoolExecutor from concurrent import futures import contextlib diff --git a/tornado/test/iostream_test.py b/tornado/test/iostream_test.py index f87bbf8477..9c6dbf76e6 100644 --- a/tornado/test/iostream_test.py +++ b/tornado/test/iostream_test.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, division, print_function from tornado.concurrent import Future from tornado import gen from tornado import netutil diff --git a/tornado/test/locale_test.py b/tornado/test/locale_test.py index db5d4838a8..67ed123b98 100644 --- a/tornado/test/locale_test.py +++ b/tornado/test/locale_test.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import datetime import os import shutil diff --git a/tornado/test/locks_test.py b/tornado/test/locks_test.py index 5e7cfb0b3a..1306e06c90 100644 --- a/tornado/test/locks_test.py +++ b/tornado/test/locks_test.py @@ -10,8 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. - -from __future__ import absolute_import, division, print_function from datetime import timedelta import unittest diff --git a/tornado/test/log_test.py b/tornado/test/log_test.py index 03302d6cca..ccd38dad61 100644 --- a/tornado/test/log_test.py +++ b/tornado/test/log_test.py @@ -12,8 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import, division, print_function - import contextlib import glob import logging diff --git a/tornado/test/netutil_test.py b/tornado/test/netutil_test.py index 0637dea61f..6686e9fbaa 100644 --- a/tornado/test/netutil_test.py +++ b/tornado/test/netutil_test.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import errno import os import signal diff --git a/tornado/test/options_test.py b/tornado/test/options_test.py index e6c81f5803..e38db0800f 100644 --- a/tornado/test/options_test.py +++ b/tornado/test/options_test.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, division, print_function - import datetime from io import StringIO import os diff --git a/tornado/test/process_test.py b/tornado/test/process_test.py index d12ac36b0c..e8ac81a3c7 100644 --- a/tornado/test/process_test.py +++ b/tornado/test/process_test.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import asyncio import logging import os diff --git a/tornado/test/queues_test.py b/tornado/test/queues_test.py index 5aaaf51e68..d63882a9de 100644 --- a/tornado/test/queues_test.py +++ b/tornado/test/queues_test.py @@ -10,8 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. - -from __future__ import absolute_import, division, print_function from datetime import timedelta from random import random import unittest diff --git a/tornado/test/resolve_test_helper.py b/tornado/test/resolve_test_helper.py index 429671962f..a055280d12 100644 --- a/tornado/test/resolve_test_helper.py +++ b/tornado/test/resolve_test_helper.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, division, print_function from tornado.ioloop import IOLoop from tornado.netutil import ThreadedResolver diff --git a/tornado/test/routing_test.py b/tornado/test/routing_test.py index 3cb34ad78f..722662555b 100644 --- a/tornado/test/routing_test.py +++ b/tornado/test/routing_test.py @@ -10,9 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. - -from __future__ import absolute_import, division, print_function - from tornado.httputil import HTTPHeaders, HTTPMessageDelegate, HTTPServerConnectionDelegate, ResponseStartLine # noqa: E501 from tornado.routing import HostMatches, PathMatches, ReversibleRouter, Router, Rule, RuleRouter from tornado.testing import AsyncHTTPTestCase diff --git a/tornado/test/runtests.py b/tornado/test/runtests.py index b9f797c757..f7b7cbe81e 100644 --- a/tornado/test/runtests.py +++ b/tornado/test/runtests.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - from functools import reduce import gc import io diff --git a/tornado/test/simple_httpclient_test.py b/tornado/test/simple_httpclient_test.py index 82853f3900..d9ea96b776 100644 --- a/tornado/test/simple_httpclient_test.py +++ b/tornado/test/simple_httpclient_test.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import collections from contextlib import closing import errno diff --git a/tornado/test/tcpclient_test.py b/tornado/test/tcpclient_test.py index 97996177c3..df4eee9df5 100644 --- a/tornado/test/tcpclient_test.py +++ b/tornado/test/tcpclient_test.py @@ -12,9 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. - -from __future__ import absolute_import, division, print_function - from contextlib import closing import os import socket diff --git a/tornado/test/tcpserver_test.py b/tornado/test/tcpserver_test.py index 95e21775c6..7408c780de 100644 --- a/tornado/test/tcpserver_test.py +++ b/tornado/test/tcpserver_test.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import socket import subprocess import sys @@ -141,7 +139,6 @@ def test_single(self): # As a sanity check, run the single-process version through this test # harness too. code = textwrap.dedent(""" - from __future__ import print_function from tornado.ioloop import IOLoop from tornado.tcpserver import TCPServer @@ -155,7 +152,6 @@ def test_single(self): def test_simple(self): code = textwrap.dedent(""" - from __future__ import print_function from tornado.ioloop import IOLoop from tornado.process import task_id from tornado.tcpserver import TCPServer @@ -171,7 +167,6 @@ def test_simple(self): def test_advanced(self): code = textwrap.dedent(""" - from __future__ import print_function from tornado.ioloop import IOLoop from tornado.netutil import bind_sockets from tornado.process import fork_processes, task_id diff --git a/tornado/test/template_test.py b/tornado/test/template_test.py index bd900db006..0d12a9ea00 100644 --- a/tornado/test/template_test.py +++ b/tornado/test/template_test.py @@ -1,7 +1,4 @@ -from __future__ import absolute_import, division, print_function - import os -import sys import traceback import unittest @@ -160,9 +157,12 @@ def test_break_in_apply(self): except ParseError: pass - @unittest.skipIf(sys.version_info >= division.getMandatoryRelease(), - 'no testable future imports') + @unittest.skip('no testable future imports') def test_no_inherit_future(self): + # TODO(bdarnell): make a test like this for one of the future + # imports available in python 3. Unfortunately they're harder + # to use in a template than division was. + # This file has from __future__ import division... self.assertEqual(1 / 2, 0.5) # ...but the template doesn't diff --git a/tornado/test/testing_test.py b/tornado/test/testing_test.py index c4e7ebd2b4..1e1c019b85 100644 --- a/tornado/test/testing_test.py +++ b/tornado/test/testing_test.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - from tornado import gen, ioloop from tornado.httpserver import HTTPServer from tornado.testing import AsyncHTTPTestCase, AsyncTestCase, bind_unused_port, gen_test diff --git a/tornado/test/twisted_test.py b/tornado/test/twisted_test.py index 06ed4f0588..5d90272a89 100644 --- a/tornado/test/twisted_test.py +++ b/tornado/test/twisted_test.py @@ -17,8 +17,6 @@ Unittest for the twisted-style reactor. """ -from __future__ import absolute_import, division, print_function - import logging import signal import unittest diff --git a/tornado/test/util.py b/tornado/test/util.py index 1c8f91f6c4..60e787b7da 100644 --- a/tornado/test/util.py +++ b/tornado/test/util.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import contextlib import os import platform diff --git a/tornado/test/util_test.py b/tornado/test/util_test.py index 1b7b82abf9..a8c2cc094e 100644 --- a/tornado/test/util_test.py +++ b/tornado/test/util_test.py @@ -1,5 +1,4 @@ # coding: utf-8 -from __future__ import absolute_import, division, print_function from io import StringIO import re import sys @@ -193,10 +192,9 @@ def test_unicode_escapes(self): class ExecInTest(unittest.TestCase): - # This test is python 2 only because there are no new future imports - # defined in python 3 yet. - @unittest.skipIf(sys.version_info >= print_function.getMandatoryRelease(), - 'no testable future imports') + # TODO(bdarnell): make a version of this test for one of the new + # future imports available in python 3. + @unittest.skip('no testable future imports') def test_no_inherit_future(self): # This file has from __future__ import print_function... f = StringIO() diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index 7bc3c055b7..cb1ab353c2 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - from tornado.concurrent import Future from tornado import gen from tornado.escape import json_decode, utf8, to_unicode, recursive_unicode, native_str, to_basestring # noqa: E501 diff --git a/tornado/test/websocket_test.py b/tornado/test/websocket_test.py index 8aa3d0d962..23dc2805d8 100644 --- a/tornado/test/websocket_test.py +++ b/tornado/test/websocket_test.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import functools import traceback import unittest diff --git a/tornado/test/windows_test.py b/tornado/test/windows_test.py index 48faa5b5bc..62a82dc12d 100644 --- a/tornado/test/windows_test.py +++ b/tornado/test/windows_test.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, division, print_function import functools import os import socket diff --git a/tornado/test/wsgi_test.py b/tornado/test/wsgi_test.py index 81ac01a587..f98da5bd73 100644 --- a/tornado/test/wsgi_test.py +++ b/tornado/test/wsgi_test.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, division, print_function from wsgiref.validate import validator from tornado.testing import AsyncHTTPTestCase diff --git a/tornado/testing.py b/tornado/testing.py index 444b62f247..4521ea9cc9 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -9,8 +9,6 @@ for the tornado.autoreload module to rerun the tests when code changes. """ -from __future__ import absolute_import, division, print_function - from collections.abc import Generator import functools import inspect diff --git a/tornado/util.py b/tornado/util.py index 01bf4a1113..e2802ac1d6 100644 --- a/tornado/util.py +++ b/tornado/util.py @@ -10,8 +10,6 @@ and `.Resolver`. """ -from __future__ import absolute_import, division, print_function - import array import atexit from inspect import getfullargspec diff --git a/tornado/web.py b/tornado/web.py index de9bd94806..76337ea831 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -57,8 +57,6 @@ def get(self): """ -from __future__ import absolute_import, division, print_function - import base64 import binascii import datetime diff --git a/tornado/websocket.py b/tornado/websocket.py index bba00d1eef..5398180aa3 100644 --- a/tornado/websocket.py +++ b/tornado/websocket.py @@ -16,8 +16,6 @@ Removed support for the draft 76 protocol version. """ -from __future__ import absolute_import, division, print_function - import base64 import hashlib import os diff --git a/tornado/wsgi.py b/tornado/wsgi.py index 3f31ddb8a3..a23be24274 100644 --- a/tornado/wsgi.py +++ b/tornado/wsgi.py @@ -27,8 +27,6 @@ """ -from __future__ import absolute_import, division, print_function - import sys from io import BytesIO import tornado