]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Turn on __future__ division too.
authorBen Darnell <ben@bendarnell.com>
Thu, 9 Feb 2012 08:17:58 +0000 (00:17 -0800)
committerBen Darnell <ben@bendarnell.com>
Thu, 9 Feb 2012 08:17:58 +0000 (00:17 -0800)
All existing uses of division were already using a float for at least
one operand (except the tests that just do 1/0 as a quick way to throw
an exception).

We have now turned on all the __future__ options available in python2.5.

50 files changed:
maint/scripts/custom_fixers/fix_future_imports.py
tornado/__init__.py
tornado/auth.py
tornado/autoreload.py
tornado/curl_httpclient.py
tornado/database.py
tornado/escape.py
tornado/gen.py
tornado/httpclient.py
tornado/httpserver.py
tornado/httputil.py
tornado/ioloop.py
tornado/iostream.py
tornado/locale.py
tornado/netutil.py
tornado/options.py
tornado/platform/auto.py
tornado/platform/interface.py
tornado/platform/posix.py
tornado/platform/twisted.py
tornado/platform/windows.py
tornado/process.py
tornado/simple_httpclient.py
tornado/stack_context.py
tornado/template.py
tornado/test/auth_test.py
tornado/test/curl_httpclient_test.py
tornado/test/escape_test.py
tornado/test/gen_test.py
tornado/test/httpclient_test.py
tornado/test/httpserver_test.py
tornado/test/httputil_test.py
tornado/test/import_test.py
tornado/test/ioloop_test.py
tornado/test/iostream_test.py
tornado/test/process_test.py
tornado/test/run_pyversion_tests.py
tornado/test/runtests.py
tornado/test/simple_httpclient_test.py
tornado/test/stack_context_test.py
tornado/test/template_test.py
tornado/test/testing_test.py
tornado/test/twisted_test.py
tornado/test/web_test.py
tornado/test/wsgi_test.py
tornado/testing.py
tornado/util.py
tornado/web.py
tornado/websocket.py
tornado/wsgi.py

index c371a5544d65723f3fe4c206dc2d503fe0f96cb0..3037abfed780b8c208d1554bc3d51d369345a3ea 100644 (file)
@@ -21,6 +21,7 @@ class FixFutureImports(fixer_base.BaseFix):
     def new_future_import(self, old):
         new = FromImport("__future__",
                          [Name("absolute_import", prefix=" "), Comma(),
+                          Name("division", prefix=" "), Comma(),
                           Name("with_statement", prefix=" ")])
         if old is not None:
             new.prefix = old.prefix
index 8ab36594d898c6dd43a5bc30c5a667d0b5be4a32..1ea272662ea35082cb965bc106faebd6f31adba1 100644 (file)
@@ -16,7 +16,7 @@
 
 """The Tornado web server and tools."""
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 # version is a human-readable version number.
 
index 9f1a7a7a66d9fe0c19e0b75445b9921b19bc1125..e2068549694ba442cc9881efd99a891ed71ac3b5 100644 (file)
@@ -44,7 +44,7 @@ Example usage for Google OpenID::
             # Save the user with, e.g., set_secure_cookie()
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import base64
 import binascii
index 4d23f1984ac0fd87ba9c55c5026177f87594f316..2464f34683931e365bbca2a373dca51f6c7ad877 100644 (file)
@@ -26,7 +26,7 @@ and Google AppEngine.  It also will not work correctly when HTTPServer's
 multi-process mode is used.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import functools
 import logging
index 9cfbbb74c11438240a006eb92ff482784ade1aab..c6213c05d24f90bbfd0f33b22a8154d0cfdd6995 100644 (file)
@@ -16,7 +16,7 @@
 
 """Blocking and non-blocking HTTP client implementations using pycurl."""
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import cStringIO
 import collections
index 26e4a603a3631619ff63e6f24466d7ec040c716b..a74879b03dd34c613debf4ac0bd22cf1d7da28b9 100644 (file)
@@ -16,7 +16,7 @@
 
 """A lightweight wrapper around MySQLdb."""
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import copy
 import MySQLdb.constants
index a9de7e3965c1c6d74932acf345f0f2d0054e2bf1..2136e64999923ba80d9a585b9ecc4d1390437037 100644 (file)
@@ -20,7 +20,7 @@ Also includes a few other miscellaneous string manipulation functions that
 have crept in over time.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import htmlentitydefs
 import re
index 21ba8f8278cba7bad2b887cf9465b9fe1660704e..04bc4039e16deb13be9780b4727bdeb16e987d04 100644 (file)
@@ -62,7 +62,7 @@ it was called with one argument, the result is that argument.  If it was
 called with more than one argument or any keyword arguments, the result
 is an `Arguments` object, which is a named tuple ``(args, kwargs)``.
 """
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import functools
 import operator
index 5b4bac240608436f66b80ff089864581b5167a33..345b9b324009a73b1d0fcc9f526353aa8155d1f3 100644 (file)
@@ -29,7 +29,7 @@ you use a recent version of ``libcurl`` and ``pycurl``.  Currently the minimum
 supported version is 7.18.2, and the recommended version is 7.21.1 or newer.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import calendar
 import email.utils
index 11602d287f73f97d6cff92cc5f583045deaa3b7f..eabb5debe44ce6f64226636cb44db6caa3adcbf7 100644 (file)
@@ -24,7 +24,7 @@ This module also defines the `HTTPRequest` class which is exposed via
 `tornado.web.RequestHandler.request`.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import Cookie
 import logging
index a197707b0f06d81563437246c6ce19f0728db9e4..4f86c3782056e611b92930b192b5196f8bd7f461 100644 (file)
@@ -16,7 +16,7 @@
 
 """HTTP utility code shared by clients and servers."""
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import logging
 import urllib
index 44627f6c77d931af6a7982f880a63a30e1c08604..be294c45f11be5cf309eb91e95fea85e4c7c3b3d 100644 (file)
@@ -26,7 +26,7 @@ In addition to I/O events, the `IOLoop` can also schedule time-based events.
 `IOLoop.add_timeout` is a non-blocking alternative to `time.sleep`.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import datetime
 import errno
index 95c659615fb0f153fda42b516ec208cdb91d9e08..b9ba13548d94768b3e97edba02afc741082aa5bd 100644 (file)
@@ -16,7 +16,7 @@
 
 """A utility class to write to and read from a non-blocking socket."""
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import collections
 import errno
index dd2a0e233c157ea4051e311d3dc754fd1e5d6737..f36ed5a6bd64a7c144fad433f97f46c1c17ce434 100644 (file)
@@ -39,7 +39,7 @@ supported by gettext and related tools).  If neither method is called,
 the locale.translate method will simply return the original string.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import csv
 import datetime
index 517367791db11d515a906441f4752129c5d56bff..416d03062adf66792b77280c280cfc7c5053696a 100644 (file)
@@ -16,7 +16,7 @@
 
 """Miscellaneous network utility code."""
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import errno
 import logging
index a7344421be7417f48706cb70c9ebd691cb1e424c..db9521ea4f83a0e6b6c7fef17f4cf5d432912e15 100644 (file)
@@ -48,7 +48,7 @@ kwarg to define). We also accept multi-value options. See the documentation
 for define() below.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import datetime
 import logging
index 086fe70b503b9ed2077e93f6c638f7593ea9374e..68cf2d2187906a28a6afdd328c8014e921130034 100644 (file)
@@ -23,7 +23,7 @@ Most code that needs access to this functionality should do e.g.::
     from tornado.platform.auto import set_close_exec
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import os
 
index 0879b5a0bc99301889496852f083628b18b00a68..c08f8eaf313cae9563c6b2d4743aae81116aecab 100644 (file)
@@ -21,7 +21,7 @@ for other tornado.platform modules.  Most code should import the appropriate
 implementation from `tornado.platform.auto`.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 def set_close_exec(fd):
     """Sets the close-on-exec bit (``FD_CLOEXEC``)for a file descriptor."""
index 40afbad4e82f570de1a09b258d68b851ed1c67ae..ae5abed82c80b4ae1bb929f53a1fca9f30c92094 100644 (file)
@@ -16,7 +16,7 @@
 
 """Posix implementations of platform-specific functionality."""
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import fcntl
 import os
index ed426fcc3477f0f9af1660c277798cf12640f8e9..7aa1a805d6e97abaf8700caa3b4b049ac824ce4e 100644 (file)
@@ -44,7 +44,7 @@ before closing the `IOLoop`.
 This module has been tested with Twisted versions 11.0.0 and 11.1.0.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import functools
 import logging
index cef82e901a3f5b55b31823d02820caffc9bfaa46..16fd66090b9446675cbac8433d5066da048a420a 100644 (file)
@@ -2,7 +2,7 @@
 # for production use.
 
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 import ctypes
 import ctypes.wintypes
 import socket
index 4958fa499d2ed39ebe71ee30b9a9eb125c7f8f08..5a33e696b3e4cc1cff013cfff0d36985f0666dfd 100644 (file)
@@ -16,7 +16,7 @@
 
 """Utilities for working with multiple processes."""
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import errno
 import logging
index a6cba17baac6f994a10be6c9d7fade36824d9dd6..1f35b0989babbcbf5f06bb3c5a00b1c3f9c8a8f6 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 from tornado.escape import utf8, _unicode, native_str
 from tornado.httpclient import HTTPRequest, HTTPResponse, HTTPError, AsyncHTTPClient, main
index fe229cdcb94cd07ef9b836a32005d8a001500d7c..c3fb022347d631baf4f4dd11d11892e99d63a285 100644 (file)
@@ -66,7 +66,7 @@ Here are a few rules of thumb for when it's necessary:
   block that references your `StackContext`.
 '''
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import contextlib
 import functools
index 69813eb5adf1f9f560e7b1920359987792642042..c3e3cccea5e7613e7d7e925a7b45f7ac507ebeae 100644 (file)
@@ -172,7 +172,7 @@ with ``{# ... #}``.
     Same as the python ``while`` statement.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import cStringIO
 import datetime
index 06903a0bc8cecbfe3847db2239d34ba4d66057e1..e77396d430fe0e6ca17b30922784f5c49eed3078 100644 (file)
@@ -4,7 +4,7 @@
 # python 3)
 
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 from tornado.auth import OpenIdMixin, OAuthMixin, OAuth2Mixin
 from tornado.escape import json_decode
 from tornado.testing import AsyncHTTPTestCase, LogTrapTestCase
index 35aaf97580146d1a29bb10a13eb7150e09f2fe24..1085462cbe4df6ae12e7934fab502286088b6ed0 100644 (file)
@@ -1,4 +1,4 @@
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 from tornado.test.httpclient_test import HTTPClientCommonTestCase
 
 try:
index b34fcab50fda11a136c739b8c84dcee8c36d5773..37c9383174bdceb24908d8f23a778451d08339ed 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 import tornado.escape
 import unittest
 
index 2f40e774d36577eb9d894a4946e4a6d2c532fd85..e4e018c73b8e0422d8e3e19d23d76e2164c8a96b 100644 (file)
@@ -1,4 +1,4 @@
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 import functools
 from tornado.escape import url_escape
 from tornado.httpclient import AsyncHTTPClient
index bf1e19cd2af72c3b89bac15db631b238c517da26..8cfa8f91a6824ce08113a5d9a61c2261bceed63d 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import base64
 import binascii
index ba0e18d2e355794f06281fa1528f3feea13a5f4a..5f75c752581d3dc59877b1a5b85f32382e62522d 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 from tornado import httpclient, simple_httpclient, netutil
 from tornado.escape import json_decode, utf8, _unicode, recursive_unicode, native_str
 from tornado.httpserver import HTTPServer
index 00f740d82f41508c3404656cc31a19f5e3c8b9b6..440f6e6e77c217c02b502baeec096270bcd02e25 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 from tornado.httputil import url_concat, parse_multipart_form_data, HTTPHeaders
 from tornado.escape import utf8
 from tornado.testing import LogTrapTestCase
index 7a25fdb5a07c7e94de763a9935b4305bd759cf3c..030bb20eb1f49c9c5ed73d58e956cad3d40f92e5 100644 (file)
@@ -1,4 +1,4 @@
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 import unittest
 
 class ImportTest(unittest.TestCase):
index b01afce137e2c51cbfcf0abf65bfa792227ac100..159f91858b08355e90a82932c4f3cb14b1c0bbb3 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 import datetime
 import unittest
 import time
index 0509205f9ade865af70c06da27e020810ba40a5d..c58da56f45baed7abe44f2bdff30cd575e0b0ddf 100644 (file)
@@ -1,4 +1,4 @@
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 from tornado import netutil
 from tornado.ioloop import IOLoop
 from tornado.iostream import IOStream
index 1546f3ddea5a1c06d76bc6c2a554f6ad752a76a3..28f4e06d1a165380733210d6948215a17fbe5945 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 import logging
 import os
 import signal
index 672d49561e4b5c8d996cbb598e09d27be5ad3b51..c150656e0ec668a44d63944290013230618ba53a 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 """Runs the tornado test suite with all supported python interpreters."""
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import os
 import subprocess
index 14782ac7b9aa477aefc7dc97539c516c67324e07..6827de0aadcd1f051ba5329e0e1b173e2f844f85 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 import unittest
 
 TEST_MODULES = [
index 4d241b027bf80a0be7380b8e6c9008e6c2d368a9..35b30877ec30fd14642e4d37935467a648b333fd 100644 (file)
@@ -1,4 +1,4 @@
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import collections
 import gzip
index 1fbfa4d724e23da6de871c6d10d9a182b15aa1d1..73c84402021ef2040e7840119fc687a875d852cf 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 from tornado.stack_context import StackContext, wrap
 from tornado.testing import AsyncHTTPTestCase, AsyncTestCase, LogTrapTestCase
index bf9b3f039a8e83cddd7c93f9c5fe37edb689ecef..546778848c0ec9c8d75411e8314b0f04a75c3ae4 100644 (file)
@@ -1,4 +1,4 @@
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import traceback
 
index 3a40fb4afbee9751660c30044a557881162a7d23..c2887396fc52da9083b28cb29328ce4d83acf94c 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 import unittest
 from tornado.testing import AsyncTestCase, LogTrapTestCase
 
index 9d4e5c9d895b8ce057a85bea6a7247eb0b0bce3f..60b1ff4aa75754cf59d44602e80ad3bebdaed419 100644 (file)
@@ -17,7 +17,7 @@
 Unittest for the twisted-style reactor.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import os
 import thread
index c84755523be2e8e2b934b96dba985713cbe78944..11a4d5609fd7e8dee11eee93d069da98b42b77a6 100644 (file)
@@ -1,4 +1,4 @@
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 from tornado.escape import json_decode, utf8, to_unicode, recursive_unicode, native_str
 from tornado.iostream import IOStream
 from tornado.template import DictLoader
index ac4564e4f080fe26a96a7a3b69992afc9f314b64..185b4683ca8110c9f4eb84db48726ed686bc7da7 100644 (file)
@@ -1,4 +1,4 @@
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 from wsgiref.validate import validator
 
 from tornado.testing import AsyncHTTPTestCase, LogTrapTestCase
index 15b59ae0f2be49848fb0ae2c3c78ce5484415f21..f607de8431997e6d0299cdfd1f94cb40e10ab2bb 100644 (file)
@@ -18,7 +18,7 @@ inheritance.  See the docstrings for each class/function below for more
 information.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 from cStringIO import StringIO
 try:
index f597becb70b5af440bbef0415e0aec8a6a75980c..b08bd9ad6b2458ce84e2ffa943b8cae85b866643 100644 (file)
@@ -1,6 +1,6 @@
 """Miscellaneous utility functions."""
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 class ObjectDict(dict):
     """Makes a dictionary behave like an object."""
index 91008936223f490839e1e639cca23562fe01eaf0..aa42855f61b9a912f7facf0ac21bc28004e1c108 100644 (file)
@@ -49,7 +49,7 @@ threads it is important to use IOLoop.add_callback to transfer control
 back to the main thread before finishing the request.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import Cookie
 import base64
index 773b94bfc19e00a96b2f74cc4488f0b920821373..05ba286d7fba95e601f10726aed99a6b26cbb5b5 100644 (file)
@@ -17,7 +17,7 @@ communication between the browser and server.
    documentation for caveats).
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 # Author: Jacob Kristhammar, 2010
 
 import array
index 08ce4eaa9175394bd3695cff39738d22b7a06d4a..783b6b2e9fd650478a57a433bf1f7a77b306b933 100644 (file)
@@ -29,7 +29,7 @@ provides WSGI support in two ways:
   and Tornado handlers in a single server.
 """
 
-from __future__ import absolute_import, with_statement
+from __future__ import absolute_import, division, with_statement
 
 import Cookie
 import cgi