Skip to content

Commit

Permalink
*: Remove Python2 __future__ imports throughout the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
bdarnell committed Jul 14, 2018
1 parent 6fc9998 commit e332a7d
Show file tree
Hide file tree
Showing 81 changed files with 8 additions and 159 deletions.
1 change: 0 additions & 1 deletion demos/file_upload/file_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion demos/tcpecho/client.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion maint/circlerefs/circlerefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions maint/scripts/test_resolvers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python
from __future__ import print_function

import pprint
import socket

Expand Down
1 change: 0 additions & 1 deletion maint/vm/windows/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tornado/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tornado/_locale_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"አማርኛ"},
Expand Down
2 changes: 0 additions & 2 deletions tornado/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ async def get(self):
"""

from __future__ import absolute_import, division, print_function

import base64
import binascii
import hashlib
Expand Down
2 changes: 0 additions & 2 deletions tornado/autoreload.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
"""

from __future__ import absolute_import, division, print_function

import os
import sys

Expand Down
1 change: 0 additions & 1 deletion tornado/concurrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tornado/curl_httpclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tornado/escape.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
have crept in over time.
"""

from __future__ import absolute_import, division, print_function

import html.entities
import json
import re
Expand Down
2 changes: 0 additions & 2 deletions tornado/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ def get(self):
via ``singledispatch``.
"""
from __future__ import absolute_import, division, print_function

import asyncio
import builtins
import collections
Expand Down
2 changes: 0 additions & 2 deletions tornado/http1connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions tornado/httpclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient")
"""

from __future__ import absolute_import, division, print_function

import functools
import time
import weakref
Expand Down
2 changes: 0 additions & 2 deletions tornado/httpserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tornado/httputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
via `tornado.web.RequestHandler.request`.
"""

from __future__ import absolute_import, division, print_function

import calendar
import collections
import copy
Expand Down
2 changes: 0 additions & 2 deletions tornado/ioloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
"""

from __future__ import absolute_import, division, print_function

import asyncio
from concurrent.futures import ThreadPoolExecutor
import datetime
Expand Down
2 changes: 0 additions & 2 deletions tornado/iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
* `PipeIOStream`: Pipe-based IOStream implementation.
"""

from __future__ import absolute_import, division, print_function

import collections
import errno
import io
Expand Down
2 changes: 0 additions & 2 deletions tornado/locale.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tornado/locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions tornado/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tornado/netutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

"""Miscellaneous network utility code."""

from __future__ import absolute_import, division, print_function

import errno
import os
import sys
Expand Down
2 changes: 0 additions & 2 deletions tornado/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ def start_server():
underscores.
"""

from __future__ import absolute_import, division, print_function

import datetime
import numbers
import re
Expand Down
1 change: 0 additions & 1 deletion tornado/platform/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tornado/platform/auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
1 change: 0 additions & 1 deletion tornado/platform/caresresolver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import, division, print_function
import pycares # type: ignore
import socket

Expand Down
2 changes: 0 additions & 2 deletions tornado/platform/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
2 changes: 0 additions & 2 deletions tornado/platform/posix.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

"""Posix implementations of platform-specific functionality."""

from __future__ import absolute_import, division, print_function

import fcntl
import os

Expand Down
2 changes: 0 additions & 2 deletions tornado/platform/twisted.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions tornado/platform/windows.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 0 additions & 2 deletions tornado/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tornado/queues.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
"""

from __future__ import absolute_import, division, print_function

import collections
import heapq

Expand Down
2 changes: 0 additions & 2 deletions tornado/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ def request_callable(request):
"""

from __future__ import absolute_import, division, print_function

import re
from functools import partial

Expand Down
2 changes: 0 additions & 2 deletions tornado/simple_httpclient.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion tornado/tcpclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

"""A non-blocking TCP connection factory.
"""
from __future__ import absolute_import, division, print_function

import functools
import socket
Expand Down
1 change: 0 additions & 1 deletion tornado/tcpserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tornado/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tornado/test/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tornado/test/asyncio_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions tornado/test/auth_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tornado/test/autoreload_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import, division, print_function
import os
import shutil
import subprocess
Expand Down
2 changes: 0 additions & 2 deletions tornado/test/concurrent_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tornado/test/curl_httpclient_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# coding: utf-8
from __future__ import absolute_import, division, print_function

from hashlib import md5
import unittest

Expand Down
2 changes: 0 additions & 2 deletions tornado/test/escape_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import unittest

import tornado.escape
Expand Down
2 changes: 0 additions & 2 deletions tornado/test/gen_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import asyncio
from concurrent import futures
import gc
Expand Down
1 change: 0 additions & 1 deletion tornado/test/gettext_translations/extract_me.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 0 additions & 2 deletions tornado/test/http1connection_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import socket

from tornado.http1connection import HTTP1Connection
Expand Down
Loading

0 comments on commit e332a7d

Please sign in to comment.