diff --git a/.travis.yml b/.travis.yml
index 6e20573ffa44ce5c72e38aacf58a02c3711a25a8..eb28e459cb1cad3bab6b4d391a599bbb21e97d5c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,25 +1,41 @@
-language: python
-
-python:
-  - "3.4"
-  - "3.3"
-  - "2.7"
-  - "2.6"
-
 sudo: false
+language: python
+cache: pip
 
-# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
-# These packages only exist on Ubuntu 13.04 and newer:
-# No dependencies currently unless using Python 2.6.
+matrix:
+  include:
+    - python: 2.6
+      env: TOXENV=py26
+    - python: 2.7
+      env: TOXENV=py27
+    - python: 3.3
+      env: TOXENV=py33
+    - python: 3.4
+      env: TOXENV=py34
+    - python: 3.5
+      env: TOXENV=py35
+    - python: 3.6
+      env: TOXENV=py36
+    - python: 3.7
+      env: TOXENV=py37
+      dist: xenial    # required for Python 3.7 (travis-ci/travis-ci#9069)
+      sudo: required  # required for Python 3.7 (travis-ci/travis-ci#9069)
 
 install:
-  - if [[ $TRAVIS_PYTHON_VERSION == 2.6* ]]; then pip install -r requirements_py26.txt --use-mirrors; fi
-  - python setup.py install
+  - pip install tox==2.9.1
+  - pip install virtualenv==15.2.0
+  - pip install py==1.4.30
+  - pip install pluggy==0.5.2
 
-# command to run tests, e.g. python setup.py test
+before_script:
+  # Run flake8 tests only on Python 2.7 and 3.7...
+  # 1) stop the build if there are Python syntax errors or undefined names
+  # 2) exit-zero treats all errors as warnings.  The GitHub editor is 127 chars wide
+  - if [[ $TRAVIS_PYTHON_VERSION == *.7 ]]; then
+      pip install flake8;
+      flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics;
+      flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics; 
+    fi
 
 script:
-  # We might like to get out of the source directory before running tests to
-  # avoid PYTHONPATH confusion? As an example, see here:
-  #     https://github.com/tornadoweb/tornado/blob/master/.travis.yml
-  - python setup.py test
+  - tox
diff --git a/LICENSE.txt b/LICENSE.txt
index c4dfd4b0133849be98f7220c557077765b46d9a6..d41c85d1b2dcf60644dc099b1d304e35af33b50e 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2013-2016 Python Charmers Pty Ltd, Australia
+Copyright (c) 2013-2018 Python Charmers Pty Ltd, Australia
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/MANIFEST.in b/MANIFEST.in
index fcdb9c63af2c0416d9b29bf21379c36f60469743..d0e9f3d11755311d6e3935f4b8369b74e63f66bd 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -25,4 +25,3 @@ recursive-include tests *.au
 recursive-include tests *.gif
 recursive-include tests *.py
 recursive-include tests *.txt
-
diff --git a/PKG-INFO b/PKG-INFO
index f1f3b672448f0aa754b5b47479e85f89ab4951a6..88b577ab0e8dee9988c2ec8ef16c74dd7363874c 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
 Name: future
-Version: 0.16.0
+Version: 0.17.1
 Summary: Clean single-source support for Python 3 and 2
 Home-page: https://python-future.org
 Author: Ed Schofield
@@ -84,20 +84,24 @@ Description:
         
         Licensing
         ---------
-        Copyright 2013-2016 Python Charmers Pty Ltd, Australia.
+        Copyright 2013-2018 Python Charmers Pty Ltd, Australia.
         The software is distributed under an MIT licence. See LICENSE.txt.
         
         
 Keywords: future past python3 migration futurize backport six 2to3 modernize pasteurize 3to2
 Platform: UNKNOWN
 Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2
 Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
 Classifier: Programming Language :: Python :: 3.3
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
 Classifier: License :: OSI Approved
 Classifier: License :: OSI Approved :: MIT License
 Classifier: Development Status :: 4 - Beta
 Classifier: Intended Audience :: Developers
+Requires-Python: >=2.6, !=3.0.*, !=3.1.*, !=3.2.*
diff --git a/README.rst b/README.rst
index 868ed14b0d3a9ad4bb8ed20583610621815bcfb2..807ea2a003a9944d5b749264534da4531bd1226e 100644
--- a/README.rst
+++ b/README.rst
@@ -68,7 +68,7 @@ statements. For example, this code behaves identically on Python 2.6/2.7 after
 these imports as it does on Python 3.3+:
 
 .. code-block:: python
-    
+
     from __future__ import absolute_import, division, print_function
     from builtins import (bytes, str, open, super, range,
                           zip, round, input, int, pow, object)
@@ -93,7 +93,7 @@ these imports as it does on Python 3.3+:
 
     # Extra arguments for the open() function
     f = open('japanese.txt', encoding='utf-8', errors='replace')
-    
+
     # New zero-argument super() function:
     class VerboseList(list):
         def append(self, item):
@@ -103,15 +103,15 @@ these imports as it does on Python 3.3+:
     # New iterable range object with slicing support
     for i in range(10**15)[:10]:
         pass
-    
+
     # Other iterators: map, zip, filter
     my_iter = zip(range(3), ['a', 'b', 'c'])
     assert my_iter != list(my_iter)
-    
+
     # The round() function behaves as it does in Python 3, using
     # "Banker's Rounding" to the nearest even last digit:
     assert round(0.1250, 2) == 0.12
-    
+
     # input() replaces Py2's raw_input() (with no eval()):
     name = input('What is your name? ')
     print('Hello ' + name)
@@ -187,7 +187,7 @@ Futurize: 2 to both
 For example, running ``futurize -w mymodule.py`` turns this Python 2 code:
 
 .. code-block:: python
-    
+
     import Queue
     from urllib2 import urlopen
 
@@ -202,14 +202,14 @@ For example, running ``futurize -w mymodule.py`` turns this Python 2 code:
 into this code which runs on both Py2 and Py3:
 
 .. code-block:: python
-    
+
     from __future__ import print_function
     from future import standard_library
     standard_library.install_aliases()
     from builtins import input
     import queue
     from urllib.request import urlopen
-    
+
     def greet(name):
         print('Hello', end=' ')
         print(name)
@@ -233,14 +233,14 @@ Python 3. First install it:
 .. code-block:: bash
 
     $ pip3 install plotrique==0.2.5-7 --no-compile   # to ignore SyntaxErrors
-    
+
 (or use ``pip`` if this points to your Py3 environment.)
 
 Then pass a whitelist of module name prefixes to the ``autotranslate()`` function.
 Example:
 
 .. code-block:: bash
-    
+
     $ python3
 
     >>> from past import autotranslate
@@ -264,12 +264,14 @@ For more info, see :ref:`translation`.
 Licensing
 ---------
 
-:Author:  Ed Schofield
+:Author:  Ed Schofield, Jordan M. Adler, et al
 
-:Copyright: 2013-2016 Python Charmers Pty Ltd, Australia.
+:Copyright: 2013-2018 Python Charmers Pty Ltd, Australia.
 
-:Sponsor: Python Charmers Pty Ltd, Australia, and Python Charmers Pte
-          Ltd, Singapore. http://pythoncharmers.com
+:Sponsors: Python Charmers Pty Ltd, Australia, and Python Charmers Pte
+           Ltd, Singapore. http://pythoncharmers.com
+           
+           Pinterest https://opensource.pinterest.com/
 
 :Licence: MIT. See ``LICENSE.txt`` or `here <http://python-future.org/credits.html>`_.
 
@@ -284,4 +286,3 @@ If you are new to Python-Future, check out the `Quickstart Guide
 
 For an update on changes in the latest version, see the `What's New
 <http://python-future.org/whatsnew.html>`_ page.
-
diff --git a/TESTING.txt b/TESTING.txt
index 13aeca83fec939947692c29c9c800c757d8ca840..1c29b6a6182cfaea9be3027371ced9473f90c58a 100644
--- a/TESTING.txt
+++ b/TESTING.txt
@@ -1,9 +1,7 @@
-Currently the tests are passing on OS X and Linux on Python 2.6, 2.7, 3.3 and 3.4.
+Currently the tests are passing on OS X and Linux on Python 2.7 and 3.4.
 
-The test suite can be run either with:
+The test suite can be run with:
 
-    $ python setup.py test
+    $ tox
 
-which uses the unittest module's test discovery mechanism, or with:
-
-    $ py.test
+which tests the module under a number of different python versions, where available.
diff --git a/discover_tests.py b/discover_tests.py
deleted file mode 100644
index 9f2e581daa19759502d159cb08662d74e3c95b0a..0000000000000000000000000000000000000000
--- a/discover_tests.py
+++ /dev/null
@@ -1,58 +0,0 @@
-"""
-Simple auto test discovery.
-
-From http://stackoverflow.com/a/17004409
-"""
-import os
-import sys
-import unittest
-
-if not hasattr(unittest.defaultTestLoader, 'discover'):
-    try:
-        import unittest2 as unittest
-    except ImportError:
-        raise ImportError('The unittest2 module is required to run tests on Python 2.6')
-
-def additional_tests():
-    setup_file = sys.modules['__main__'].__file__
-    setup_dir = os.path.abspath(os.path.dirname(setup_file))
-    test_dir = os.path.join(setup_dir, 'tests')
-    test_suite = unittest.defaultTestLoader.discover(test_dir)
-    blacklist = []
-    if '/home/travis' in __file__:
-        # Skip some tests that fail on travis-ci
-        blacklist.append('test_command')
-    return exclude_tests(test_suite, blacklist)
-
-
-class SkipCase(unittest.TestCase):
-    def skeleton_run_test(self):
-        raise unittest.SkipTest("Test fails spuriously on travis-ci")
-
-
-def exclude_tests(suite, blacklist):
-    """
-    Example:
-    
-    blacklist = [
-        'test_some_test_that_should_be_skipped',
-        'test_another_test_that_should_be_skipped'
-    ]
-    """
-    new_suite = unittest.TestSuite()
-    
-    for test_group in suite._tests:
-        for test in test_group:
-            if not hasattr(test, '_tests'):
-                # e.g. ModuleImportFailure
-                new_suite.addTest(test)
-                continue
-            for subtest in test._tests:
-                method = subtest._testMethodName
-                if method in blacklist:
-                    setattr(test,
-                            method,
-                            getattr(SkipCase(), 'skeleton_run_test'))
-            new_suite.addTest(test)
-    return new_suite
-
diff --git a/docs/3rd-party-py3k-compat-code/ipython_py3compat.py b/docs/3rd-party-py3k-compat-code/ipython_py3compat.py
index f80a6963e95c4aef5333fdaebae65da62ff38078..c9fbb2c17ecdb161bc59b2234f0636e2f7687571 100755
--- a/docs/3rd-party-py3k-compat-code/ipython_py3compat.py
+++ b/docs/3rd-party-py3k-compat-code/ipython_py3compat.py
@@ -41,9 +41,9 @@ def _modify_str_or_docstring(str_change_func):
         else:
             func = func_or_str
             doc = func.__doc__
-        
+
         doc = str_change_func(doc)
-        
+
         if func:
             func.__doc__ = doc
             return func
@@ -52,97 +52,97 @@ def _modify_str_or_docstring(str_change_func):
 
 if sys.version_info[0] >= 3:
     PY3 = True
-    
+
     input = input
     builtin_mod_name = "builtins"
-    
+
     str_to_unicode = no_code
     unicode_to_str = no_code
     str_to_bytes = encode
     bytes_to_str = decode
     cast_bytes_py2 = no_code
-    
+
     def isidentifier(s, dotted=False):
         if dotted:
             return all(isidentifier(a) for a in s.split("."))
         return s.isidentifier()
-    
+
     open = orig_open
-    
+
     MethodType = types.MethodType
-    
+
     def execfile(fname, glob, loc=None):
         loc = loc if (loc is not None) else glob
         exec compile(open(fname, 'rb').read(), fname, 'exec') in glob, loc
-    
+
     # Refactor print statements in doctests.
     _print_statement_re = re.compile(r"\bprint (?P<expr>.*)$", re.MULTILINE)
     def _print_statement_sub(match):
         expr = match.groups('expr')
         return "print(%s)" % expr
-    
+
     @_modify_str_or_docstring
     def doctest_refactor_print(doc):
         """Refactor 'print x' statements in a doctest to print(x) style. 2to3
         unfortunately doesn't pick up on our doctests.
-        
+
         Can accept a string or a function, so it can be used as a decorator."""
         return _print_statement_re.sub(_print_statement_sub, doc)
-    
+
     # Abstract u'abc' syntax:
     @_modify_str_or_docstring
     def u_format(s):
         """"{u}'abc'" --> "'abc'" (Python 3)
-        
+
         Accepts a string or a function, so it can be used as a decorator."""
         return s.format(u='')
 
 else:
     PY3 = False
-    
+
     input = raw_input
     builtin_mod_name = "__builtin__"
-    
+
     str_to_unicode = decode
     unicode_to_str = encode
     str_to_bytes = no_code
     bytes_to_str = no_code
     cast_bytes_py2 = cast_bytes
-    
+
     import re
     _name_re = re.compile(r"[a-zA-Z_][a-zA-Z0-9_]*$")
     def isidentifier(s, dotted=False):
         if dotted:
             return all(isidentifier(a) for a in s.split("."))
         return bool(_name_re.match(s))
-    
+
     class open(object):
         """Wrapper providing key part of Python 3 open() interface."""
         def __init__(self, fname, mode="r", encoding="utf-8"):
             self.f = orig_open(fname, mode)
             self.enc = encoding
-        
+
         def write(self, s):
             return self.f.write(s.encode(self.enc))
-        
+
         def read(self, size=-1):
             return self.f.read(size).decode(self.enc)
-        
+
         def close(self):
             return self.f.close()
-        
+
         def __enter__(self):
             return self
-        
+
         def __exit__(self, etype, value, traceback):
             self.f.close()
-    
+
     def MethodType(func, instance):
         return types.MethodType(func, instance, type(instance))
-    
+
     # don't override system execfile on 2.x:
     execfile = execfile
-    
+
     def doctest_refactor_print(func_or_str):
         return func_or_str
 
@@ -151,7 +151,7 @@ else:
     @_modify_str_or_docstring
     def u_format(s):
         """"{u}'abc'" --> "u'abc'" (Python 2)
-        
+
         Accepts a string or a function, so it can be used as a decorator."""
         return s.format(u='u')
 
diff --git a/docs/3rd-party-py3k-compat-code/pandas_py3k.py b/docs/3rd-party-py3k-compat-code/pandas_py3k.py
index 6070c0e9c53791f62d133c4deab15975b28f2e54..2a8eb5aed75cc45afa2491ebd0c863b08632e7e5 100755
--- a/docs/3rd-party-py3k-compat-code/pandas_py3k.py
+++ b/docs/3rd-party-py3k-compat-code/pandas_py3k.py
@@ -14,7 +14,7 @@ Key items to import for 2/3 compatible code:
   * Uses the original method if available, otherwise uses items, keys, values.
 * types:
     * text_type: unicode in Python 2, str in Python 3
-    * binary_type: str in Python 2, bythes in Python 3
+    * binary_type: str in Python 2, bytes in Python 3
     * string_types: basestring in Python 2, str in Python 3
 * bind_method: binds functions to classes
 
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index d2372bf699fb4d6bb78b7e2f11e3d1a61c1f2079..e4433221560a84faa6afe021ce5e95a4b9e74806 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -15,7 +15,7 @@
 -->
 <!--<h3>Useful Links</h3>
 <ul>
-  <li><a href="http://pypi.python.org/pypi/future">on PyPI</a></li>
+  <li><a href="https://pypi.org/project/future/">on PyPI</a></li>
   <li><a href="https://github.com/PythonCharmers/python-future">on GitHub</a></li>
 </ul>
 -->
diff --git a/docs/_themes/future/static/future.css_t b/docs/_themes/future/static/future.css_t
index 6130f5c3131fc9715df0173b40c0fce28ab73210..593da466421131b92a42ce755b8303e8d224127a 100644
--- a/docs/_themes/future/static/future.css_t
+++ b/docs/_themes/future/static/future.css_t
@@ -14,11 +14,11 @@
 {% set sidebar_width = '220px' %}
 {% set font_family = 'Geneva, sans serif' %}
 {% set header_font_family = 'Oxygen, ' ~ font_family %}
- 
+
 @import url("basic.css");
- 
+
 /* -- page layout ----------------------------------------------------------- */
- 
+
 body {
     font-family: {{ font_family }};
     font-size: 17px;
@@ -49,7 +49,7 @@ div.sphinxsidebar {
 hr {
     border: 1px solid #B1B4B6;
 }
- 
+
 div.body {
     background-color: #ffffff;
     color: #3E4349;
@@ -60,7 +60,7 @@ img.floatingflask {
     padding: 0 0 10px 10px;
     float: right;
 }
- 
+
 div.footer {
     width: {{ page_width }};
     margin: 20px auto 30px auto;
@@ -76,7 +76,7 @@ div.footer a {
 div.related {
     display: none;
 }
- 
+
 div.sphinxsidebar a {
     color: #444;
     text-decoration: none;
@@ -86,7 +86,7 @@ div.sphinxsidebar a {
 div.sphinxsidebar a:hover {
     border-bottom: 1px solid #999;
 }
- 
+
 div.sphinxsidebar {
     font-size: 15px;
     line-height: 1.5;
@@ -101,7 +101,7 @@ div.sphinxsidebarwrapper p.logo {
     margin: 0;
     text-align: center;
 }
- 
+
 div.sphinxsidebar h3,
 div.sphinxsidebar h4 {
     font-family: {{ font_family }};
@@ -115,7 +115,7 @@ div.sphinxsidebar h4 {
 div.sphinxsidebar h4 {
     font-size: 20px;
 }
- 
+
 div.sphinxsidebar h3 a {
     color: #444;
 }
@@ -126,7 +126,7 @@ div.sphinxsidebar p.logo a:hover,
 div.sphinxsidebar h3 a:hover {
     border: none;
 }
- 
+
 div.sphinxsidebar p {
     color: #555;
     margin: 10px 0;
@@ -137,7 +137,7 @@ div.sphinxsidebar ul {
     padding: 0;
     color: #000;
 }
- 
+
 div.sphinxsidebar input {
     border: 1px solid #ccc;
     font-family: {{ font_family }};
@@ -147,19 +147,19 @@ div.sphinxsidebar input {
 div.sphinxsidebar form.search input[name="q"] {
     width: 130px;
 }
- 
+
 /* -- body styles ----------------------------------------------------------- */
- 
+
 a {
     color: #aa0000;
     text-decoration: underline;
 }
- 
+
 a:hover {
     color: #dd0000;
     text-decoration: underline;
 }
- 
+
 div.body h1,
 div.body h2,
 div.body h3,
@@ -172,25 +172,25 @@ div.body h6 {
     padding: 0;
     color: black;
 }
- 
+
 div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; }
 div.body h2 { font-size: 180%; }
 div.body h3 { font-size: 150%; }
 div.body h4 { font-size: 130%; }
 div.body h5 { font-size: 100%; }
 div.body h6 { font-size: 100%; }
- 
+
 a.headerlink {
     color: #ddd;
     padding: 0 4px;
     text-decoration: none;
 }
- 
+
 a.headerlink:hover {
     color: #444;
     background: #eaeaea;
 }
- 
+
 div.body p, div.body dd, div.body li {
     line-height: 1.4em;
 }
@@ -237,20 +237,20 @@ div.note {
     background-color: #eee;
     border: 1px solid #ccc;
 }
- 
+
 div.seealso {
     background-color: #ffc;
     border: 1px solid #ff6;
 }
- 
+
 div.topic {
     background-color: #eee;
 }
- 
+
 p.admonition-title {
     display: inline;
 }
- 
+
 p.admonition-title:after {
     content: ":";
 }
@@ -344,7 +344,7 @@ ul, ol {
     margin: 10px 0 10px 30px;
     padding: 0;
 }
- 
+
 pre {
     background: #eee;
     padding: 7px 30px;
@@ -361,7 +361,7 @@ dl dl pre {
     margin-left: -90px;
     padding-left: 90px;
 }
- 
+
 tt {
     background-color: #E8EFF0;
     color: #222;
diff --git a/docs/automatic_conversion.rst b/docs/automatic_conversion.rst
index fc3428bfc4e6b78638692e76d8fe7e3f68fc7c6e..5c718da5a3e3fe453e0a763b76a439fd4d9ad986 100644
--- a/docs/automatic_conversion.rst
+++ b/docs/automatic_conversion.rst
@@ -27,4 +27,3 @@ mostly unchanged on both Python 2 and Python 3.
 .. include:: pasteurize.rst
 
 .. include:: conversion_limitations.rst
-
diff --git a/docs/bind_method.rst b/docs/bind_method.rst
index 7eb91a43f0818096bda4f290f488507df24a93bd..d737384cb557937f670d2fd76675018277deac32 100644
--- a/docs/bind_method.rst
+++ b/docs/bind_method.rst
@@ -9,10 +9,10 @@ from the language. To bind a method to a class compatibly across Python
 3 and Python 2, you can use the :func:`bind_method` helper function::
 
     from future.utils import bind_method
-    
+
     class Greeter(object):
         pass
-    
+
     def greet(self, message):
         print(message)
 
@@ -24,6 +24,6 @@ from the language. To bind a method to a class compatibly across Python
 
 On Python 3, calling ``bind_method(cls, name, func)`` is equivalent to
 calling ``setattr(cls, name, func)``. On Python 2 it is equivalent to::
-    
+
     import types
     setattr(cls, name, types.MethodType(func, None, cls))
diff --git a/docs/bytes_object.rst b/docs/bytes_object.rst
index 1c4a7cc7536bc57b778dbbc45d5ab0d6c7a24419..110280adfb7b64bc91a29a1435ec4ea99cecc9bd 100644
--- a/docs/bytes_object.rst
+++ b/docs/bytes_object.rst
@@ -26,7 +26,7 @@ strict separation of unicode strings and byte strings as Python 3's
     Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
     TypeError: argument can't be unicode string
-    
+
     >>> bytes(b',').join([u'Fred', u'Bill'])
     Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
@@ -52,9 +52,9 @@ behaviours to Python 3's :class:`bytes`::
 Currently the easiest way to ensure identical behaviour of byte-strings
 in a Py2/3 codebase is to wrap all byte-string literals ``b'...'`` in a
 :func:`~bytes` call as follows::
-    
+
     from builtins import bytes
-    
+
     # ...
 
     b = bytes(b'This is my bytestring')
@@ -78,4 +78,3 @@ identically on Python 2.x and 3.x::
 This feature is in alpha. Please leave feedback `here
 <https://github.com/PythonCharmers/python-future/issues>`_ about whether this
 works for you.
- 
diff --git a/docs/changelog.rst b/docs/changelog.rst
index d4fdf55d1fec8a9222d90cfe0aa1528a4b916dfa..aa317b96280bdc06501ebad160a965dd2cb1a4a3 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -319,7 +319,7 @@ Py3-style ``__next__`` method.
 In this example, the code defines a Py3-style iterator with a ``__next__``
 method. The ``object`` class defines a ``next`` method for Python 2 that maps
 to ``__next__``::
-    
+
     from future.builtins import object
 
     class Upper(object):
@@ -451,7 +451,7 @@ Many small improvements and fixes have been made across the project. Some highli
 - Scrubbing of the ``sys.modules`` cache performed by ``remove_hooks()`` (also
   called by the ``suspend_hooks`` and ``hooks`` context managers) is now more
   conservative.
-  
+
 ..  Is this still true?
 ..  It now removes only modules with Py3 names (such as
 ..  ``urllib.parse``) and not the corresponding ``future.standard_library.*``
@@ -530,7 +530,7 @@ is now possible on Python 2 and 3::
 
 Previously, this required manually removing ``http`` and ``http.client`` from
 ``sys.modules`` before importing ``requests`` on Python 2.x. (Issue #19)
-   
+
 This change should also improve the compatibility of the standard library hooks
 with any other module that provides its own Python 2/3 compatibility code.
 
@@ -560,7 +560,7 @@ compatibility code.
 
 There is a new ``--unicode-literals`` flag to ``futurize`` that adds the
 import::
-    
+
     from __future__ import unicode_literals
 
 to the top of each converted module. Without this flag, ``futurize`` now no
@@ -575,7 +575,7 @@ The ``pasteurize`` script for converting from Py3 to Py2/3 still adds
 Changes in version 0.11 (2014-01-28)
 ====================================
 
-There are several major new features in version 0.11. 
+There are several major new features in version 0.11.
 
 
 ``past`` package
@@ -615,10 +615,10 @@ it like this::
 
     $ pip3 install plotrique==0.2.5-7 --no-compile   # to ignore SyntaxErrors
     $ python3
-    
+
 Then pass in a whitelist of module name prefixes to the ``past.autotranslate()``
 function. Example::
-    
+
     >>> from past import autotranslate
     >>> autotranslate(['plotrique'])
     >>> import plotrique
@@ -678,7 +678,7 @@ compatibility.
 As of v0.12, importing ``future.standard_library``
 will no longer install import hooks by default. Instead, please install the
 import hooks explicitly as follows::
-    
+
     from future import standard_library
     standard_library.install_hooks()
 
@@ -721,7 +721,7 @@ If not using this context manager, it is now encouraged to add an explicit call
 
     from future import standard_library
     standard_library.install_hooks()
-    
+
     import queue
     import html
     import http.client
@@ -754,7 +754,7 @@ over large dictionaries. For example::
 
     from __future__ import print_function
     from future.builtins import dict, range
-    
+
     squares = dict({i: i**2 for i in range(10**7)})
 
     assert not isinstance(d.items(), list)
@@ -876,7 +876,7 @@ The unused ``hacks`` module has also been removed from the source tree.
 ``isinstance()`` added to :mod:`future.builtins` (v0.8.2)
 ---------------------------------------------------------
 
-It is now possible to use ``isinstance()`` calls normally after importing ``isinstance`` from 
+It is now possible to use ``isinstance()`` calls normally after importing ``isinstance`` from
 ``future.builtins``. On Python 2, this is specially defined to be compatible with
 ``future``'s backported ``int``, ``str``, and ``bytes`` types, as well as
 handling Python 2's ``int``/``long`` distinction.
@@ -992,7 +992,7 @@ v0.8.1:
   * Move a few more safe ``futurize`` fixes from stage2 to stage1
 
   * Bug fixes to :mod:`future.utils`
-  
+
 v0.8:
   * Added Python 2.6 support
 
@@ -1080,7 +1080,7 @@ v0.3.2:
   * Added ``UserList``, ``UserString``, ``UserDict`` classes to ``collections`` module
 
   * Removed ``int`` -> ``long`` mapping
-  
+
   * Added backported ``_markupbase.py`` etc. with new-style classes to fix travis-ci build problems
 
   * Added working ``html`` and ``http.client`` backported modules
diff --git a/docs/compatible_idioms.rst b/docs/compatible_idioms.rst
index e48ac6d1ca3c02d3ddbf37a8c6f8eae38b907283..52a6a8b0b891536dbd346d778a76e11f655a7a9b 100644
--- a/docs/compatible_idioms.rst
+++ b/docs/compatible_idioms.rst
@@ -1,9 +1,9 @@
 .. _compatible-idioms:
- 
+
 Cheat Sheet: Writing Python 2-3 compatible code
 ===============================================
 
--  **Copyright (c):** 2013-2016 Python Charmers Pty Ltd, Australia.
+-  **Copyright (c):** 2013-2018 Python Charmers Pty Ltd, Australia.
 -  **Author:** Ed Schofield.
 -  **Licence:** Creative Commons Attribution.
 
@@ -16,8 +16,8 @@ video is here: http://www.youtube.com/watch?v=KOqk8j11aAI&t=10m14s.)
 
 Minimum versions:
 
--  Python 2: 2.6+
--  Python 3: 3.3+
+-  Python 2: 2.7+
+-  Python 3: 3.4+
 
 Setup
 -----
@@ -66,7 +66,7 @@ interpreting it as a tuple:
 
     # Python 2 and 3:
     from __future__ import print_function    # (at top of module)
-    
+
     print('Hello', 'Guido')
 .. code:: python
 
@@ -76,7 +76,7 @@ interpreting it as a tuple:
 
     # Python 2 and 3:
     from __future__ import print_function
-    
+
     print('Hello', file=sys.stderr)
 .. code:: python
 
@@ -86,7 +86,7 @@ interpreting it as a tuple:
 
     # Python 2 and 3:
     from __future__ import print_function
-    
+
     print('Hello', end='')
 Raising exceptions
 ~~~~~~~~~~~~~~~~~~
@@ -116,14 +116,14 @@ Raising exceptions with a traceback:
     from six import reraise as raise_
     # or
     from future.utils import raise_
-    
+
     traceback = sys.exc_info()[2]
     raise_(ValueError, "dodgy value", traceback)
 .. code:: python
 
     # Python 2 and 3: option 2
     from future.utils import raise_with_traceback
-    
+
     raise_with_traceback(ValueError("dodgy value"))
 Exception chaining (PEP 3134):
 
@@ -145,7 +145,7 @@ Exception chaining (PEP 3134):
 
     # Python 2 and 3:
     from future.utils import raise_from
-    
+
     class FileDatabase:
         def __init__(self, filename):
             try:
@@ -199,7 +199,7 @@ Integer division (rounding down):
 
     # Python 2 and 3:
     from __future__ import division    # (at top of module)
-    
+
     assert 3 / 2 == 1.5
 "Old division" (i.e. compatible with Py2 behaviour):
 
@@ -211,7 +211,7 @@ Integer division (rounding down):
 
     # Python 2 and 3:
     from past.utils import old_div
-    
+
     a = old_div(b, c)    # always same as / on Py2
 Long integers
 ~~~~~~~~~~~~~
@@ -223,14 +223,14 @@ Short integers are gone in Python 3 and ``long`` has become ``int``
 
     # Python 2 only
     k = 9223372036854775808L
-    
+
     # Python 2 and 3:
     k = 9223372036854775808
 .. code:: python
 
     # Python 2 only
     bigint = 1L
-    
+
     # Python 2 and 3
     from builtins import int
     bigint = int(1)
@@ -241,20 +241,20 @@ To test whether a value is an integer (of any kind):
     # Python 2 only:
     if isinstance(x, (int, long)):
         ...
-    
+
     # Python 3 only:
     if isinstance(x, int):
         ...
-    
+
     # Python 2 and 3: option 1
     from builtins import int    # subclass of long on Py2
-    
+
     if isinstance(x, int):             # matches both int and long on Py2
         ...
-    
+
     # Python 2 and 3: option 2
     from past.builtins import long
-    
+
     if isinstance(x, (int, long)):
         ...
 Octal constants
@@ -282,7 +282,7 @@ Metaclasses
 
     class BaseForm(object):
         pass
-    
+
     class FormType(type):
         pass
 .. code:: python
@@ -302,7 +302,7 @@ Metaclasses
     from six import with_metaclass
     # or
     from future.utils import with_metaclass
-    
+
     class Form(with_metaclass(FormType, BaseForm)):
         pass
 Strings and bytes
@@ -320,7 +320,7 @@ prefixes:
     # Python 2 only
     s1 = 'The Zen of Python'
     s2 = u'きたないのよりきれいな方がいい\n'
-    
+
     # Python 2 and 3
     s1 = u'The Zen of Python'
     s2 = u'きたないのよりきれいな方がいい\n'
@@ -334,7 +334,7 @@ this idiom to make all string literals in a module unicode strings:
 
     # Python 2 and 3
     from __future__ import unicode_literals    # at top of module
-    
+
     s1 = 'The Zen of Python'
     s2 = 'きたないのよりきれいな方がいい\n'
 See http://python-future.org/unicode\_literals.html for more discussion
@@ -347,7 +347,7 @@ Byte-string literals
 
     # Python 2 only
     s = 'This must be a byte-string'
-    
+
     # Python 2 and 3
     s = b'This must be a byte-string'
 To loop over a byte-string with possible high-bit characters, obtaining
@@ -358,11 +358,11 @@ each character as a byte-string of length 1:
     # Python 2 only:
     for bytechar in 'byte-string with high-bit chars like \xf9':
         ...
-    
+
     # Python 3 only:
     for myint in b'byte-string with high-bit chars like \xf9':
         bytechar = bytes([myint])
-    
+
     # Python 2 and 3:
     from builtins import bytes
     for myint in bytes(b'byte-string with high-bit chars like \xf9'):
@@ -376,7 +376,7 @@ convert an int into a 1-char byte string:
     for myint in b'byte-string with high-bit chars like \xf9':
         char = chr(myint)    # returns a unicode string
         bytechar = char.encode('latin-1')
-    
+
     # Python 2 and 3:
     from builtins import bytes, chr
     for myint in bytes(b'byte-string with high-bit chars like \xf9'):
@@ -391,10 +391,10 @@ basestring
     a = u'abc'
     b = 'def'
     assert (isinstance(a, basestring) and isinstance(b, basestring))
-    
+
     # Python 2 and 3: alternative 1
     from past.builtins import basestring    # pip install future
-    
+
     a = u'abc'
     b = b'def'
     assert (isinstance(a, basestring) and isinstance(b, basestring))
@@ -402,7 +402,7 @@ basestring
 
     # Python 2 and 3: alternative 2: refactor the code to avoid considering
     # byte-strings as strings.
-    
+
     from builtins import str
     a = u'abc'
     b = b'def'
@@ -435,7 +435,7 @@ StringIO
     from StringIO import StringIO
     # or:
     from cStringIO import StringIO
-    
+
     # Python 2 and 3:
     from io import BytesIO     # for handling byte strings
     from io import StringIO    # for handling unicode strings
@@ -450,13 +450,13 @@ Suppose the package is:
         __init__.py
         submodule1.py
         submodule2.py
-        
+
 
 and the code below is in ``submodule1.py``:
 
 .. code:: python
 
-    # Python 2 only: 
+    # Python 2 only:
     import submodule2
 .. code:: python
 
@@ -505,17 +505,17 @@ Iterable dict values:
 
     # Python 2 and 3: option 1
     from builtins import dict
-    
+
     heights = dict(Fred=175, Anne=166, Joe=192)
     for key in heights.values():    # efficient on Py2 and Py3
         ...
 .. code:: python
 
     # Python 2 and 3: option 2
-    from builtins import itervalues
+    from future.utils import itervalues
     # or
     from six import itervalues
-    
+
     for key in itervalues(heights):
         ...
 Iterable dict items:
@@ -528,13 +528,13 @@ Iterable dict items:
 .. code:: python
 
     # Python 2 and 3: option 1
-    for (key, value) in heights.items():    # inefficient on Py2    
+    for (key, value) in heights.items():    # inefficient on Py2
         ...
 .. code:: python
 
     # Python 2 and 3: option 2
     from future.utils import viewitems
-    
+
     for (key, value) in viewitems(heights):   # also behaves like a set
         ...
 .. code:: python
@@ -543,7 +543,7 @@ Iterable dict items:
     from future.utils import iteritems
     # or
     from six import iteritems
-    
+
     for (key, value) in iteritems(heights):
         ...
 dict keys/values/items as a list
@@ -577,14 +577,14 @@ dict values as a list:
 
     # Python 2 and 3: option 2
     from builtins import dict
-    
+
     heights = dict(Fred=175, Anne=166, Joe=192)
     valuelist = list(heights.values())
 .. code:: python
 
     # Python 2 and 3: option 3
     from future.utils import listvalues
-    
+
     valuelist = listvalues(heights)
 .. code:: python
 
@@ -592,7 +592,7 @@ dict values as a list:
     from future.utils import itervalues
     # or
     from six import itervalues
-    
+
     valuelist = list(itervalues(heights))
 dict items as a list:
 
@@ -604,7 +604,7 @@ dict items as a list:
 
     # Python 2 and 3: option 2
     from future.utils import listitems
-    
+
     itemlist = listitems(heights)
 .. code:: python
 
@@ -612,7 +612,7 @@ dict items as a list:
     from future.utils import iteritems
     # or
     from six import iteritems
-    
+
     itemlist = list(iteritems(heights))
 Custom class behaviour
 ----------------------
@@ -630,7 +630,7 @@ Custom iterators
             return self._iter.next().upper()
         def __iter__(self):
             return self
-    
+
     itr = Upper('hello')
     assert itr.next() == 'H'     # Py2-style
     assert list(itr) == list('ELLO')
@@ -638,7 +638,7 @@ Custom iterators
 
     # Python 2 and 3: option 1
     from builtins import object
-    
+
     class Upper(object):
         def __init__(self, iterable):
             self._iter = iter(iterable)
@@ -646,7 +646,7 @@ Custom iterators
             return next(self._iter).upper()  # builtin next() function calls
         def __iter__(self):
             return self
-    
+
     itr = Upper('hello')
     assert next(itr) == 'H'      # compatible style
     assert list(itr) == list('ELLO')
@@ -654,7 +654,7 @@ Custom iterators
 
     # Python 2 and 3: option 2
     from future.utils import implements_iterator
-    
+
     @implements_iterator
     class Upper(object):
         def __init__(self, iterable):
@@ -663,7 +663,7 @@ Custom iterators
             return next(self._iter).upper()  # builtin next() function calls
         def __iter__(self):
             return self
-    
+
     itr = Upper('hello')
     assert next(itr) == 'H'
     assert list(itr) == list('ELLO')
@@ -678,19 +678,19 @@ Custom ``__str__`` methods
             return 'Unicode string: \u5b54\u5b50'
         def __str__(self):
             return unicode(self).encode('utf-8')
-    
+
     a = MyClass()
     print(a)    # prints encoded string
 .. code:: python
 
     # Python 2 and 3:
     from future.utils import python_2_unicode_compatible
-    
+
     @python_2_unicode_compatible
     class MyClass(object):
         def __str__(self):
             return u'Unicode string: \u5b54\u5b50'
-    
+
     a = MyClass()
     print(a)    # prints string encoded as utf-8 on Py2
 
@@ -710,20 +710,20 @@ Custom ``__nonzero__`` vs ``__bool__`` method:
             self.l = l
         def __nonzero__(self):
             return all(self.l)
-    
+
     container = AllOrNothing([0, 100, 200])
     assert not bool(container)
 .. code:: python
 
     # Python 2 and 3:
     from builtins import object
-    
+
     class AllOrNothing(object):
         def __init__(self, l):
             self.l = l
         def __bool__(self):
             return all(self.l)
-    
+
     container = AllOrNothing([0, 100, 200])
     assert not bool(container)
 Lists versus iterators
@@ -766,21 +766,21 @@ range
 
     # Python 2 and 3: forward-compatible: option 2
     from builtins import range
-    
+
     mylist = list(range(5))
     assert mylist == [0, 1, 2, 3, 4]
 .. code:: python
 
     # Python 2 and 3: option 3
     from future.utils import lrange
-    
+
     mylist = lrange(5)
     assert mylist == [0, 1, 2, 3, 4]
 .. code:: python
 
     # Python 2 and 3: backward compatible
     from past.builtins import range
-    
+
     mylist = range(5)
     assert mylist == [0, 1, 2, 3, 4]
 map
@@ -801,7 +801,7 @@ map
 
     # Python 2 and 3: option 2
     from builtins import map
-    
+
     mynewlist = list(map(f, myoldlist))
     assert mynewlist == [f(x) for x in myoldlist]
 .. code:: python
@@ -811,21 +811,21 @@ map
         import itertools.imap as map
     except ImportError:
         pass
-    
+
     mynewlist = list(map(f, myoldlist))    # inefficient on Py2
     assert mynewlist == [f(x) for x in myoldlist]
 .. code:: python
 
     # Python 2 and 3: option 4
     from future.utils import lmap
-    
+
     mynewlist = lmap(f, myoldlist)
     assert mynewlist == [f(x) for x in myoldlist]
 .. code:: python
 
     # Python 2 and 3: option 5
     from past.builtins import map
-    
+
     mynewlist = map(f, myoldlist)
     assert mynewlist == [f(x) for x in myoldlist]
 imap
@@ -835,7 +835,7 @@ imap
 
     # Python 2 only:
     from itertools import imap
-    
+
     myiter = imap(func, myoldlist)
     assert isinstance(myiter, iter)
 .. code:: python
@@ -847,7 +847,7 @@ imap
 
     # Python 2 and 3: option 1
     from builtins import map
-    
+
     myiter = map(func, myoldlist)
     assert isinstance(myiter, iter)
 .. code:: python
@@ -857,9 +857,17 @@ imap
         import itertools.imap as map
     except ImportError:
         pass
-    
+
+    myiter = map(func, myoldlist)
+    assert isinstance(myiter, iter)
+.. code:: python
+
+    # Python 2 and 3: option 3
+    from six.moves import map
+
     myiter = map(func, myoldlist)
     assert isinstance(myiter, iter)
+
 zip, izip
 ~~~~~~~~~
 
@@ -882,13 +890,13 @@ File IO with open()
     f = open('myfile.txt')
     data = f.read()              # as a byte string
     text = data.decode('utf-8')
-    
+
     # Python 2 and 3: alternative 1
     from io import open
     f = open('myfile.txt', 'rb')
     data = f.read()              # as bytes
     text = data.decode('utf-8')  # unicode, not bytes
-    
+
     # Python 2 and 3: alternative 2
     from io import open
     f = open('myfile.txt', encoding='utf-8')
@@ -904,7 +912,7 @@ reduce()
 
     # Python 2 and 3:
     from functools import reduce
-    
+
     assert reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) == 1+2+3+4+5
 raw\_input()
 ~~~~~~~~~~~~
@@ -918,7 +926,7 @@ raw\_input()
 
     # Python 2 and 3:
     from builtins import input
-    
+
     name = input('What is your name? ')
     assert isinstance(name, str)    # native str on Py2 and Py3
 input()
@@ -946,7 +954,7 @@ file()
 
     # Python 2 and 3:
     f = open(pathname)
-    
+
     # But preferably, use this:
     from io import open
     f = open(pathname, 'rb')   # if f.read() should return bytes
@@ -990,13 +998,13 @@ execfile()
 
     # Python 2 and 3: alternative 1
     from past.builtins import execfile
-    
+
     execfile('myfile.py')
 .. code:: python
 
     # Python 2 and 3: alternative 2
     exec(compile(open('myfile.py').read()))
-    
+
     # This can sometimes cause this:
     #     SyntaxError: function ... uses import * and bare exec ...
     # See https://github.com/PythonCharmers/python-future/issues/37
@@ -1090,7 +1098,7 @@ chr()
 
     # Python 2 and 3: option 1
     from builtins import chr
-    
+
     assert chr(64).encode('latin-1') == b'@'
     assert chr(0xc8).encode('latin-1') == b'\xc8'
 .. code:: python
@@ -1102,7 +1110,7 @@ chr()
 
     # Python 2 and 3: option 2
     from builtins import bytes
-    
+
     assert bytes([64]) == b'@'
     assert bytes([0xc8]) == b'\xc8'
 cmp()
@@ -1148,22 +1156,22 @@ dbm modules
     import dbm
     import dumbdbm
     import gdbm
-    
+
     # Python 2 and 3: alternative 1
     from future import standard_library
     standard_library.install_aliases()
-    
+
     import dbm
     import dbm.ndbm
     import dbm.dumb
     import dbm.gnu
-    
+
     # Python 2 and 3: alternative 2
     from future.moves import dbm
     from future.moves.dbm import dumb
     from future.moves.dbm import ndbm
     from future.moves.dbm import gnu
-    
+
     # Python 2 and 3: alternative 3
     from six.moves import dbm_gnu
     # (others not supported)
@@ -1174,44 +1182,12 @@ commands / subprocess modules
 
     # Python 2 only
     from commands import getoutput, getstatusoutput
-    
-    # Python 2 and 3
-    from future import standard_library
-    standard_library.install_aliases()
-    
-    from subprocess import getoutput, getstatusoutput
-subprocess.check\_output()
-~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-.. code:: python
-
-    # Python 2.7 and above
-    from subprocess import check_output
-    
-    # Python 2.6 and above: alternative 1
-    from future.moves.subprocess import check_output
-    
-    # Python 2.6 and above: alternative 2
+    # Python 2 and 3
     from future import standard_library
     standard_library.install_aliases()
-    
-    from subprocess import check_output
-collections: Counter and OrderedDict
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-.. code:: python
-
-    # Python 2.7 and above
-    from collections import Counter, OrderedDict
-    
-    # Python 2.6 and above: alternative 1
-    from future.moves.collections import Counter, OrderedDict
-    
-    # Python 2.6 and above: alternative 2
-    from future import standard_library
-    standard_library.install_aliases()
-    
-    from collections import Counter, OrderedDict
+    from subprocess import getoutput, getstatusoutput
 StringIO module
 ~~~~~~~~~~~~~~~
 
@@ -1237,7 +1213,7 @@ http module
     import BaseHTTPServer
     import SimpleHTTPServer
     import CGIHttpServer
-    
+
     # Python 2 and 3 (after ``pip install future``):
     import http.client
     import http.cookies
@@ -1251,14 +1227,14 @@ xmlrpc module
     # Python 2 only:
     import DocXMLRPCServer
     import SimpleXMLRPCServer
-    
+
     # Python 2 and 3 (after ``pip install future``):
     import xmlrpc.server
 .. code:: python
 
     # Python 2 only:
     import xmlrpclib
-    
+
     # Python 2 and 3 (after ``pip install future``):
     import xmlrpc.client
 html escaping and entities
@@ -1268,13 +1244,13 @@ html escaping and entities
 
     # Python 2 and 3:
     from cgi import escape
-    
+
     # Safer (Python 2 and 3, after ``pip install future``):
     from html import escape
-    
+
     # Python 2 only:
     from htmlentitydefs import codepoint2name, entitydefs, name2codepoint
-    
+
     # Python 2 and 3 (after ``pip install future``):
     from html.entities import codepoint2name, entitydefs, name2codepoint
 html parsing
@@ -1284,10 +1260,10 @@ html parsing
 
     # Python 2 only:
     from HTMLParser import HTMLParser
-    
+
     # Python 2 and 3 (after ``pip install future``)
     from html.parser import HTMLParser
-    
+
     # Python 2 and 3 (alternative 2):
     from future.moves.html.parser import HTMLParser
 urllib module
@@ -1313,7 +1289,7 @@ You may like to use Requests (http://python-requests.org) instead.
     # Python 2 and 3: easiest option
     from future.standard_library import install_aliases
     install_aliases()
-    
+
     from urllib.parse import urlparse, urlencode
     from urllib.request import urlopen, Request
     from urllib.error import HTTPError
@@ -1321,7 +1297,7 @@ You may like to use Requests (http://python-requests.org) instead.
 
     # Python 2 and 3: alternative 2
     from future.standard_library import hooks
-    
+
     with hooks():
         from urllib.parse import urlparse, urlencode
         from urllib.request import urlopen, Request
@@ -1358,9 +1334,9 @@ Tkinter
     import FileDialog
     import ScrolledText
     import SimpleDialog
-    import Tix  
+    import Tix
     import Tkconstants
-    import Tkdnd   
+    import Tkdnd
     import tkColorChooser
     import tkCommonDialog
     import tkFileDialog
@@ -1368,7 +1344,7 @@ Tkinter
     import tkMessageBox
     import tkSimpleDialog
     import ttk
-    
+
     # Python 2 and 3 (after ``pip install future``):
     import tkinter
     import tkinter.dialog
@@ -1392,7 +1368,7 @@ socketserver
 
     # Python 2 only:
     import SocketServer
-    
+
     # Python 2 and 3 (after ``pip install future``):
     import socketserver
 copy\_reg, copyreg
@@ -1402,7 +1378,7 @@ copy\_reg, copyreg
 
     # Python 2 only:
     import copy_reg
-    
+
     # Python 2 and 3 (after ``pip install future``):
     import copyreg
 configparser
@@ -1412,7 +1388,7 @@ configparser
 
     # Python 2 only:
     from ConfigParser import ConfigParser
-    
+
     # Python 2 and 3 (after ``pip install configparser``):
     from configparser import ConfigParser
 queue
@@ -1422,7 +1398,7 @@ queue
 
     # Python 2 only:
     from Queue import Queue, heapq, deque
-    
+
     # Python 2 and 3 (after ``pip install future``):
     from queue import Queue, heapq, deque
 repr, reprlib
@@ -1432,7 +1408,7 @@ repr, reprlib
 
     # Python 2 only:
     from repr import aRepr, repr
-    
+
     # Python 2 and 3 (after ``pip install future``):
     from reprlib import aRepr, repr
 UserDict, UserList, UserString
@@ -1444,16 +1420,16 @@ UserDict, UserList, UserString
     from UserDict import UserDict
     from UserList import UserList
     from UserString import UserString
-    
+
     # Python 3 only:
     from collections import UserDict, UserList, UserString
-    
+
     # Python 2 and 3: alternative 1
     from future.moves.collections import UserDict, UserList, UserString
-    
+
     # Python 2 and 3: alternative 2
     from six.moves import UserDict, UserList, UserString
-    
+
     # Python 2 and 3: alternative 3
     from future.standard_library import install_aliases
     install_aliases()
@@ -1465,16 +1441,16 @@ itertools: filterfalse, zip\_longest
 
     # Python 2 only:
     from itertools import ifilterfalse, izip_longest
-    
+
     # Python 3 only:
     from itertools import filterfalse, zip_longest
-    
+
     # Python 2 and 3: alternative 1
     from future.moves.itertools import filterfalse, zip_longest
-    
+
     # Python 2 and 3: alternative 2
     from six.moves import filterfalse, zip_longest
-    
+
     # Python 2 and 3: alternative 3
     from future.standard_library import install_aliases
     install_aliases()
diff --git a/docs/conf.py b/docs/conf.py
index 78183b9928634fe69fe1df0c6eff0d64e77f2d30..729114057db6943458fe0c14255efb1681825186 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -33,7 +33,7 @@ extensions = ['sphinx.ext.autodoc',
               'sphinx.ext.intersphinx',
               'sphinx.ext.ifconfig',
               'sphinx.ext.viewcode',
-              # 'sphinxcontrib.napoleon'    # see https://readthedocs.org/projects/sphinxcontrib-napoleon/
+              # 'sphinxcontrib.napoleon'    # see https://sphinxcontrib-napoleon.readthedocs.io/
               # 'sphinx.ext.napoleon'       # use this in Sphinx 1.3+
              ]
 
@@ -51,7 +51,7 @@ master_doc = 'index'
 
 # General information about the project.
 project = u'Python-Future'
-copyright = u'2013-2016, Python Charmers Pty Ltd, Australia'
+copyright = u'2013-2018, Python Charmers Pty Ltd, Australia'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
diff --git a/docs/contents.rst.inc b/docs/contents.rst.inc
index cedf7bb76d51a4a4c83639b50ed7b1940219c688..7c9bbf2fafd2a2e9cbd2bf6c51a536024564c85b 100644
--- a/docs/contents.rst.inc
+++ b/docs/contents.rst.inc
@@ -24,4 +24,3 @@ Indices and tables
 * :ref:`genindex`
 * :ref:`modindex`
 * :ref:`search`
-
diff --git a/docs/credits.rst b/docs/credits.rst
index 011936d5ca6bd18de0c8a705a8ff85ef529debb0..3cf1c9c885df6256cb96a8da3351e3abbafcadbc 100644
--- a/docs/credits.rst
+++ b/docs/credits.rst
@@ -8,18 +8,18 @@ Licence
 The software is distributed under an MIT licence. The text is as follows
 (from ``LICENSE.txt``)::
 
-    Copyright (c) 2013-2016 Python Charmers Pty Ltd, Australia
-    
+    Copyright (c) 2013-2018 Python Charmers Pty Ltd, Australia
+
     Permission is hereby granted, free of charge, to any person obtaining a copy
     of this software and associated documentation files (the "Software"), to deal
     in the Software without restriction, including without limitation the rights
     to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     copies of the Software, and to permit persons to whom the Software is
     furnished to do so, subject to the following conditions:
-    
+
     The above copyright notice and this permission notice shall be included in
     all copies or substantial portions of the Software.
-    
+
     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -30,33 +30,33 @@ The software is distributed under an MIT licence. The text is as follows
 
 .. _sponsor:
 
-Sponsor
--------
+Sponsors
+--------
 Python Charmers Pty Ltd, Australia, and Python Charmers Pte Ltd, Singapore.
 http://pythoncharmers.com
 
+Pinterest https://opensource.pinterest.com/
 
 .. _authors:
 
+Maintainer
+----------
+Python-Future is currently maintained by Jordan M. Adler <jordan.m.adler@gmail.com>.
+
 Authors
 -------
+Python-Future is largely written by Ed Schofield <ed@pythoncharmers.com> with the help of various contributors:
 
-Python-Future is written and maintained by Ed Schofield with the help of
-various contributors:
-
-Development Lead
-~~~~~~~~~~~~~~~~
-
-- Ed Schofield <ed@pythoncharmers.com>
-
-Patches
-~~~~~~~
-
+- Grant Bakker
 - Jacob Beck
+- Nate Bogdanowicz
 - Denis Cornehl
 - Nicolas Delaby
+- Jon Dufresne
 - Corey Farwell
 - Eric Firing
+- Maximilian Hils
+- Martijn Jacobs
 - Michael Joseph
 - Waldemar Kornewald
 - Alexey Kotlyarov
@@ -65,26 +65,37 @@ Patches
 - Joshua Landau
 - German Larrain
 - Chris Lasher
+- Calum Lind
+- Jon Parise
+- Matthew Parnell
+- Miga Purg
+- Éloi Rivard
 - Elliott Sales de Andrade
+- Yury Selivanov
 - Tim Shaffer
+- Louis Sautier
 - Daniel Szoska
+- Flaviu Tamas
 - Jeff Tratner
 - Tim Tröndle
 - Brad Walker
-- Mystic-Mirage (GitHub)
-- str4d (GitHub)
-- 9seconds (GitHub)
-- Varriount (GitHub)
+- cclaus (GiHub user)
+- lsm (GiHub user)
+- Mystic-Mirage (GitHub user)
+- str4d (GitHub user)
+- 9seconds (GitHub user)
+- Varriount (GitHub user)
 
 Suggestions and Feedback
 ~~~~~~~~~~~~~~~~~~~~~~~~
 
 - Chris Adams
 - Martijn Faassen
+- Joe Gordon
 - Lion Krischer
 - Danielle Madeley
 - Val Markovic
-- wluebbe (GitHub)
+- wluebbe (GitHub user)
 
 
 Other Credits
@@ -112,4 +123,3 @@ Other Credits
 
 - ``past.translation`` is inspired by and borrows some code from Sanjay Vinip's
   ``uprefix`` module.
-
diff --git a/docs/custom_iterators.rst b/docs/custom_iterators.rst
index db87b0f32872584f0c90b3a60da78e7ea0dac51b..6ff389a49af709f5fae7269a57c9fd249e30f691 100644
--- a/docs/custom_iterators.rst
+++ b/docs/custom_iterators.rst
@@ -14,7 +14,7 @@ would on Python 3. On Python 2, ``object`` then refers to the
 method that calls your ``__next__``. Use it as follows::
 
     from builtins import object
-    
+
     class Upper(object):
         def __init__(self, iterable):
             self._iter = iter(iterable)
@@ -92,4 +92,3 @@ the iterator as follows::
             return self
 
 On Python 3, as usual, this decorator does nothing.
-
diff --git a/docs/dev_notes.rst b/docs/dev_notes.rst
index d0584c461c8928b1019401dfd796c53eff3707f6..6985bca4d95d51677979d8baa6c5169e7b66de63 100644
--- a/docs/dev_notes.rst
+++ b/docs/dev_notes.rst
@@ -1,6 +1,6 @@
 Notes
 -----
-This module only supports Python 2.6, Python 2.7, and Python 3.1+.
+This module only supports Python 2.7, and Python 3.4+.
 
 The following renames are already supported on Python 2.7 without any
 additional work from us::
@@ -14,10 +14,3 @@ Old things that can one day be fixed automatically by futurize.py::
 
   string.uppercase -> string.ascii_uppercase   # works on either Py2.7 or Py3+
   sys.maxint -> sys.maxsize      # but this isn't identical
-
-TODO: Check out these:
-Not available on Py2.6:
-  unittest2 -> unittest?
-  buffer -> memoryview?
-
-
diff --git a/docs/development.rst b/docs/development.rst
index 530d2948c265d80451fa6a2db996a2441c80808f..a12f2ca5c469cfb5d81b1be4923262e9eb3b4080 100644
--- a/docs/development.rst
+++ b/docs/development.rst
@@ -10,13 +10,10 @@ The easiest way to start developing ``python-future`` is as follows:
 2. Run::
 
     conda install -n future2 python=2.7 pip
-    conda install -n future3 python=3.3 pip
-    
-    git clone https://github.com/PythonCharmers/python-future 
+    conda install -n future3 python=3.4 pip
+
+    git clone https://github.com/PythonCharmers/python-future
 
 3. If you are using Anaconda Python distribution, this comes without a ``test``
 module on Python 2.x. Copy ``Python-2.7.6/Lib/test`` from the Python source tree
 to ``~/anaconda/envs/yourenvname/lib/python2.7/site-packages/`.
-
-
-
diff --git a/docs/dict_object.rst b/docs/dict_object.rst
index c967d6bb84495b35ce2067d09bf99c3d89b35322..165cf763b53d56d6539426c4f7440a234f16793d 100644
--- a/docs/dict_object.rst
+++ b/docs/dict_object.rst
@@ -10,7 +10,7 @@ methods which return memory-efficient set-like iterator objects, not lists.
 If your dictionaries are small, performance is not critical, and you don't need
 the set-like behaviour of iterator objects from Python 3, you can of course
 stick with standard Python 3 code in your Py2/3 compatible codebase::
-    
+
     # Assuming d is a native dict ...
 
     for key in d:
@@ -18,7 +18,7 @@ stick with standard Python 3 code in your Py2/3 compatible codebase::
 
     for item in d.items():
         # code here
-    
+
     for value in d.values():
         # code here
 
@@ -27,26 +27,22 @@ call to ``items``, ``values`` or ``keys``.
 
 For improved efficiency, ``future.builtins`` (aliased to ``builtins``) provides
 a Python 2 ``dict`` subclass whose :func:`keys`, :func:`values`, and
-:func:`items` methods return iterators on all versions of Python >= 2.6. On
+:func:`items` methods return iterators on all versions of Python >= 2.7. On
 Python 2.7, these iterators also have the same set-like view behaviour as
 dictionaries in Python 3. This can streamline code that iterates over large
 dictionaries. For example::
 
     from __future__ import print_function
     from builtins import dict, range
-    
+
     # Memory-efficient construction:
     d = dict((i, i**2) for i in range(10**7))
-    
+
     assert not isinstance(d.items(), list)
-    
+
     # Because items() is memory-efficient, so is this:
     d2 = dict((v, k) for (k, v) in d.items())
 
-
-On Python 2.6, these methods currently return iterators but do not support the
-new Py3 set-like behaviour.
-
 As usual, on Python 3 ``dict`` imported from either ``builtins`` or
 ``future.builtins`` is just the built-in ``dict`` class.
 
@@ -82,16 +78,15 @@ The memory-efficient (and CPU-efficient) alternatives are:
 
     for (key, value) in viewitems(hugedictionary):
         # some code here
-    
+
     # Set intersection:
     d = {i**2: i for i in range(1000)}
     both = viewkeys(d) & set(range(0, 1000, 7))
-     
+
     # Set union:
     both = viewvalues(d1) | viewvalues(d2)
 
-For Python 2.6 compatibility, the functions ``iteritems`` etc. are also
-available in :mod:`future.utils`. These are equivalent to the functions of the
-same names in ``six``, which is equivalent to calling the ``iteritems`` etc.
-methods on Python 2, or to calling ``items`` etc. on Python 3.
-
+For compatibility, the functions ``iteritems`` etc. are also available in
+:mod:`future.utils`. These are equivalent to the functions of the same names in
+``six``, which is equivalent to calling the ``iteritems`` etc. methods on
+Python 2, or to calling ``items`` etc. on Python 3.
diff --git a/docs/faq.rst b/docs/faq.rst
index 57fef25e20e976c88999671ce8979f0cde4a617c..9b1eab002bc0c397067eb73884fa9d4c6c88c31a 100644
--- a/docs/faq.rst
+++ b/docs/faq.rst
@@ -5,10 +5,10 @@ Who is this for?
 ================
 
 1. People with existing or new Python 3 codebases who wish to provide
-ongoing Python 2.6 / 2.7 support easily and with little maintenance burden.
+ongoing Python 2.7 support easily and with little maintenance burden.
 
 2. People who wish to ease and accelerate migration of their Python 2 codebases
-to Python 3.3+, module by module, without giving up Python 2 compatibility.
+to Python 3.4+, module by module, without giving up Python 2 compatibility.
 
 
 Why upgrade to Python 3?
@@ -33,7 +33,7 @@ and powerful new features like the `asyncio
 .. Unicode handling is also much easier. For example, see `this page
 .. <http://pythonhosted.org/kitchen/unicode-frustrations.html>`_
 .. describing some of the problems with handling Unicode on Python 2 that
-.. Python 3 mostly solves. 
+.. Python 3 mostly solves.
 
 
 Porting philosophy
@@ -143,10 +143,10 @@ version 2.0.
 ..
     Are there any example of Python 2 packages ported to Python 3 using ``future`` and ``futurize``?
     ------------------------------------------------------------------------------------------------
-    
+
     Yes, an example is the port of ``xlwt``, available `here
     <https://github.com/python-excel/xlwt/pull/32>`_.
-    
+
     The code also contains backports for several Py3 standard library
     modules under ``future/standard_library/``.
 
@@ -189,12 +189,12 @@ Can I maintain a Python 2 codebase and use 2to3 to automatically convert to Pyth
 
 This was originally the approach recommended by Python's core developers,
 but it has some large drawbacks:
-    
+
 1. First, your actual working codebase will be stuck with Python 2's
 warts and smaller feature set for as long as you need to retain Python 2
 compatibility. This may be at least 5 years for many projects, possibly
 much longer.
-    
+
 2. Second, this approach carries the significant disadvantage that you
 cannot apply patches submitted by Python 3 users against the
 auto-generated Python 3 code. (See `this talk
@@ -217,15 +217,15 @@ complete set of support for Python 3's features, including backports of
 Python 3 builtins such as the ``bytes`` object (which is very different
 to Python 2's ``str`` object) and several standard library modules.
 
-``python-future`` supports only Python 2.6+ and Python 3.3+, whereas ``six``
+``python-future`` supports only Python 2.7+ and Python 3.4+, whereas ``six``
 supports all versions of Python from 2.4 onwards. (See
 :ref:`supported-versions`.) If you must support older Python versions,
-``six`` will be esssential for you. However, beware that maintaining
+``six`` will be essential for you. However, beware that maintaining
 single-source compatibility with older Python versions is ugly and `not
 fun <http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/>`_.
 
 If you can drop support for older Python versions, ``python-future`` leverages
-some important features introduced into Python 2.6 and 2.7, such as
+some important features introduced into Python 2.7, such as
 import hooks, and a comprehensive and well-tested set of backported
 functionality, to allow you to write more idiomatic, maintainable code with
 fewer compatibility hacks.
@@ -237,7 +237,7 @@ What is the relationship between ``python-future`` and ``python-modernize``?
 ``python-future`` contains, in addition to the ``future`` compatibility
 package, a ``futurize`` script that is similar to ``python-modernize.py``
 in intent and design. Both are based heavily on ``2to3``.
-    
+
 Whereas ``python-modernize`` converts Py2 code into a common subset of
 Python 2 and 3, with ``six`` as a run-time dependency, ``futurize``
 converts either Py2 or Py3 code into (almost) standard Python 3 code,
@@ -257,19 +257,13 @@ Platform and version support
 Which versions of Python does ``python-future`` support?
 --------------------------------------------------------
 
-Python 2.6, 2.7, and 3.3+ only.
+Python 2.7, and 3.4+ only.
 
-Python 2.6 and 2.7 introduced many important forward-compatibility
+Python 2.7 introduced many important forward-compatibility
 features (such as import hooks, ``b'...'`` literals and ``__future__``
 definitions) that greatly reduce the maintenance burden for single-source
 Py2/3 compatible code. ``future`` leverages these features and aims to
-close the remaining gap between Python 3 and 2.6 / 2.7.
-
-Python 3.2 could perhaps be supported too, although the illegal unicode
-literal ``u'...'`` syntax may be inconvenient to work around. The Py3.2
-userbase is very small, however. Please let us know via GitHub `issue #29
-<https://github.com/PythonCharmers/python-future/issues/29>`_ if you
-would like to see Py3.2 support.
+close the remaining gap between Python 3 and 2.7.
 
 
 Do you support Pypy?
@@ -314,4 +308,3 @@ Where is the repo?
 ------------------
 
 `<https://github.com/PythonCharmers/python-future>`_.
-
diff --git a/docs/future-builtins.rst b/docs/future-builtins.rst
index 6d2271e06bfd8a4197487546dd7cff7761103aa1..df8ff79dd17b2583ceec62b67f57f7d6098873c9 100644
--- a/docs/future-builtins.rst
+++ b/docs/future-builtins.rst
@@ -15,4 +15,3 @@ The ``future.builtins`` module is also accessible as ``builtins`` on Py2.
 
     >>> from builtins import round
     >>> assert round(0.1250, 2) == 0.12
-
diff --git a/docs/futurize.rst b/docs/futurize.rst
index 3e1e278d105639771eed504e6ed1576e72f8ac70..fdbf302690466eb301d9afccb4740b27988b9158 100644
--- a/docs/futurize.rst
+++ b/docs/futurize.rst
@@ -23,7 +23,7 @@ This applies fixes that modernize Python 2 code without changing the effect of
 the code. With luck, this will not introduce any bugs into the code, or will at
 least be trivial to fix. The changes are those that bring the Python code
 up-to-date without breaking Py2 compatibility. The resulting code will be
-modern Python 2.6-compatible code plus ``__future__`` imports from the
+modern Python 2.7-compatible code plus ``__future__`` imports from the
 following set:
 
 .. code-block:: python
@@ -151,7 +151,7 @@ method on exceptions.
 
     lib2to3.fixes.fix_set_literal
 
-This converts ``set([1, 2, 3]``) to ``{1, 2, 3}``, breaking Python 2.6 support.
+This converts ``set([1, 2, 3]``) to ``{1, 2, 3}``.
 
 .. code-block:: python
 
@@ -317,5 +317,3 @@ The next step would be manually tweaking the code to re-enable Python 2
 compatibility with the help of the ``future`` package. For example, you can add
 the ``@python_2_unicode_compatible`` decorator to any classes that define custom
 ``__str__`` methods. See :ref:`what-else` for more info.
-
-
diff --git a/docs/futurize_cheatsheet.rst b/docs/futurize_cheatsheet.rst
index 5f4d853ce40c33a73e14d5c964598d74d1f581bc..1fcca365bdf6a3855fb43c2da647304c8c3de088 100644
--- a/docs/futurize_cheatsheet.rst
+++ b/docs/futurize_cheatsheet.rst
@@ -13,11 +13,11 @@ Step 0: setup
 Step 0 goal: set up and see the tests passing on Python 2 and failing on Python 3.
 
 a. Clone the package from github/bitbucket. Optionally rename your repo to ``package-future``. Examples: ``reportlab-future``, ``paramiko-future``, ``mezzanine-future``.
-b. Create and activate a Python 2 conda environment or virtualenv. Install the package with ``python setup.py install`` and run its test suite on Py2.7 or Py2.6 (e.g. ``python setup.py test`` or ``py.test`` or ``nosetests``)
-c. Optionally: if there is a ``.travis.yml`` file, add Python version 3.3 and remove any versions < 2.6.
-d. Install Python 3.3 with e.g. ``sudo apt-get install python3``. On other platforms, an easy way is to use `Miniconda <http://repo.continuum.io/miniconda/index.html>`_. Then e.g.::
-    
-    conda create -n py33 python=3.3 pip
+b. Create and activate a Python 2 conda environment or virtualenv. Install the package with ``python setup.py install`` and run its test suite on Py2.7 (e.g. ``python setup.py test`` or ``py.test``)
+c. Optionally: if there is a ``.travis.yml`` file, add Python version 3.6 and remove any versions < 2.6.
+d. Install Python 3 with e.g. ``sudo apt-get install python3``. On other platforms, an easy way is to use `Miniconda <http://repo.continuum.io/miniconda/index.html>`_. Then e.g.::
+
+    conda create -n py36 python=3.6 pip
 
 .. _porting-step1:
 
@@ -27,9 +27,9 @@ Step 1: modern Py2 code
 The goal for this step is to modernize the Python 2 code without introducing any dependencies (on ``future`` or e.g. ``six``) at this stage.
 
 **1a**. Install ``future`` into the virtualenv using::
-      
+
           pip install future
-  
+
 **1b**. Run ``futurize --stage1 -w *.py subdir1/*.py subdir2/*.py``. Note that with
 recursive globbing in ``bash`` or ``zsh``, you can apply stage 1 to all Python
 source files recursively with::
@@ -49,7 +49,7 @@ Example error
 One relatively common error after conversion is::
 
     Traceback (most recent call last):
-      ... 
+      ...
       File "/home/user/Install/BleedingEdge/reportlab/tests/test_encrypt.py", line 19, in <module>
         from .test_pdfencryption import parsedoc
     ValueError: Attempted relative import in non-package
@@ -110,7 +110,7 @@ Python 3 semantics on Python 2, invoke it like this::
 
     futurize --stage2 --all-imports myfolder/*.py
 
-   
+
 **2b**. Re-run your tests on Py3 now. Make changes until your tests pass on Python 3.
 
 **2c**. Commit your changes! :)
diff --git a/docs/futurize_overview.rst b/docs/futurize_overview.rst
index 732b96b28dd97bf597097ecfc6dfb41cfa242acf..2beef1ac4e15ae5596d2bc3185e7dd1495c32f89 100644
--- a/docs/futurize_overview.rst
+++ b/docs/futurize_overview.rst
@@ -51,5 +51,5 @@ use the ``-w`` flag.
 
 For complex projects, it is probably best to divide the porting into two stages.
 Stage 1 is for "safe" changes that modernize the code but do not break Python
-2.6 compatibility or introduce a depdendency on the ``future`` package. Stage 2
+2.7 compatibility or introduce a depdendency on the ``future`` package. Stage 2
 is to complete the process.
diff --git a/docs/hindsight.rst b/docs/hindsight.rst
index a7b283a1019bbe60d176251f07fba797d877b212..b4654c6af85b428ac0ada7675a0608e835eac6ca 100644
--- a/docs/hindsight.rst
+++ b/docs/hindsight.rst
@@ -1,4 +1,3 @@
 In a perfect world, the new metaclass syntax should ideally be available in
 Python 2 as a `__future__`` import like ``from __future__ import
 new_metaclass_syntax``.
-
diff --git a/docs/imports.rst b/docs/imports.rst
index 50f97995bbcc544890beed744e4aeaa6e4a881e7..f7dcd9fce60d67ee099edf7d456d37f558500269 100644
--- a/docs/imports.rst
+++ b/docs/imports.rst
@@ -24,7 +24,7 @@ standard feature of Python, see the following docs:
 - print_function: `PEP 3105: Make print a function <http://www.python.org/dev/peps/pep-3105>`_
 - unicode_literals: `PEP 3112: Bytes literals in Python 3000 <http://www.python.org/dev/peps/pep-3112>`_
 
-These are all available in Python 2.6 and up, and enabled by default in Python 3.x.
+These are all available in Python 2.7 and up, and enabled by default in Python 3.x.
 
 
 .. _builtins-imports:
@@ -44,7 +44,7 @@ at the top of every module::
     from builtins import *
 
 On Python 3, this has no effect. (It shadows builtins with globals of the same
-names.) 
+names.)
 
 On Python 2, this import line shadows 18 builtins (listed below) to
 provide their Python 3 semantics.
@@ -59,7 +59,7 @@ Explicit forms of the imports are often preferred and are necessary for using
 certain automated code-analysis tools.
 
 The complete set of imports of builtins from ``future`` is::
-    
+
     from builtins import (ascii, bytes, chr, dict, filter, hex, input,
                           int, map, next, oct, open, pow, range, round,
                           str, super, zip)
@@ -84,7 +84,7 @@ The internal API is currently as follows::
 
 Please note that this internal API is evolving and may not be stable between
 different versions of ``future``. To understand the details of the backported
-builtins on Python 2, see the docs for these modules. 
+builtins on Python 2, see the docs for these modules.
 
 For more information on what the backported types provide, see :ref:`what-else`.
 
diff --git a/docs/index.rst b/docs/index.rst
index b9ec0888a22f6c4c0efda48f1d42e5129f2074e8..cc84c9b7d8a990c72529541bafb66a18a7b97d67 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -7,4 +7,3 @@ codebase to support both Python 2 and Python 3 with minimal overhead.
 
 
 .. include:: contents.rst.inc
-
diff --git a/docs/int_object.rst b/docs/int_object.rst
index e52c35a0da28428cdbf39c70efead626cf3606b9..f774784b2ccb8725c2d57d891592f5c9d593ead4 100644
--- a/docs/int_object.rst
+++ b/docs/int_object.rst
@@ -66,4 +66,3 @@ Without ``future`` (or with ``future`` < 0.7), this might be::
             return list(map(int, data))   # same as returning data, but with up-front typechecking
         else:
             return list(map(long, data))
-
diff --git a/docs/isinstance.rst b/docs/isinstance.rst
index 9f49250dbfc84283a64bab34392bfe32e8b2d5e8..2bb5084aa8fd8dfd9fcf9d7e54aece1094ba8315 100644
--- a/docs/isinstance.rst
+++ b/docs/isinstance.rst
@@ -4,7 +4,7 @@ isinstance
 ----------
 
 The following tests all pass on Python 3::
-    
+
     >>> assert isinstance(2**62, int)
     >>> assert isinstance(2**63, int)
     >>> assert isinstance(b'my byte-string', bytes)
@@ -81,7 +81,7 @@ to use it. (The output showing is from Py2)::
     100000000000000000000L
     >>> type(native(a))
     long
-    
+
     >>> b = bytes(b'ABC')
     >>> type(b)
     future.types.newbytes.newbytes
@@ -89,7 +89,7 @@ to use it. (The output showing is from Py2)::
     'ABC'
     >>> type(native(b))
     str
-    
+
     >>> s = str(u'ABC')
     >>> type(s)
     future.types.newstr.newstr
@@ -115,4 +115,3 @@ The objects ``native_str`` and ``native_bytes`` are available in
 
 The functions ``native_str_to_bytes`` and ``bytes_to_native_str`` are also
 available for more explicit conversions.
-
diff --git a/docs/limitations.rst b/docs/limitations.rst
index 5b13ad81ba134a7125d3bd9fbb9c9c3db25937df..0d13805dce7a40d228fee9b03c2b344a4de2ac2b 100644
--- a/docs/limitations.rst
+++ b/docs/limitations.rst
@@ -1,4 +1,3 @@
-
 limitations of the ``future`` module and differences between Py2 and Py3 that are not (yet) handled
 ===================================================================================================
 
@@ -39,7 +38,7 @@ Also:
 
       b'\x00'[0] != 0
       b'\x01'[0] != 1
-  
+
   ``futurize`` does not yet wrap all byte-string literals in a ``bytes()``
   call. This is on the to-do list. See :ref:`bytes-object` for more information.
 
@@ -51,5 +50,3 @@ Notes
   adds this back in automatically, but ensure you do this too
   when writing your classes, otherwise weird breakage when e.g. calling
   ``super()`` may occur.
-
-
diff --git a/docs/metaclasses.rst b/docs/metaclasses.rst
index c4bcdd0090c458de217f5b5d2b866dc4c823b865..d40c5a460ddce02b5cde187ee81b5141565b3ba2 100644
--- a/docs/metaclasses.rst
+++ b/docs/metaclasses.rst
@@ -5,16 +5,14 @@ Python 3 and Python 2 syntax for metaclasses are incompatible.
 ``future`` provides a function (from ``jinja2/_compat.py``) called
 :func:`with_metaclass` that can assist with specifying metaclasses
 portably across Py3 and Py2. Use it like this::
-        
+
     from future.utils import with_metaclass
 
     class BaseForm(object):
         pass
-    
+
     class FormType(type):
         pass
-    
+
     class Form(with_metaclass(FormType, BaseForm)):
         pass
-
-
diff --git a/docs/notebooks/Writing Python 2-3 compatible code.ipynb b/docs/notebooks/Writing Python 2-3 compatible code.ipynb
index f33a92040f8ec58c9434ece0079e8d57fca7934b..a3e5e156194cf0796458233b78b78cbc545f7427 100644
--- a/docs/notebooks/Writing Python 2-3 compatible code.ipynb	
+++ b/docs/notebooks/Writing Python 2-3 compatible code.ipynb	
@@ -11,7 +11,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "- **Copyright (c):** 2013-2016 Python Charmers Pty Ltd, Australia.\n",
+    "- **Copyright (c):** 2013-2018 Python Charmers Pty Ltd, Australia.\n",
     "- **Author:** Ed Schofield.\n",
     "- **Licence:** Creative Commons Attribution.\n",
     "\n",
@@ -1129,7 +1129,7 @@
    "outputs": [],
    "source": [
     "# Python 2 and 3: option 2\n",
-    "from builtins import itervalues\n",
+    "from future.utils import itervalues\n",
     "# or\n",
     "from six import itervalues\n",
     "\n",
diff --git a/docs/older_interfaces.rst b/docs/older_interfaces.rst
index 463d57759bf4a68fc6dea7ffa6adc0e3cd7bf375..546f92b92cda94e73581ce7fef84ad37d7a9c985 100644
--- a/docs/older_interfaces.rst
+++ b/docs/older_interfaces.rst
@@ -22,7 +22,7 @@ robust, at the cost of less idiomatic code. Use it as follows::
 
 If you wish to achieve the effect of a two-level import such as this::
 
-    import http.client 
+    import http.client
 
 portably on both Python 2 and Python 3, note that Python currently does not
 support syntax like this::
@@ -61,7 +61,7 @@ The functional interface is to use the ``import_`` and ``from_import``
 functions from ``future.standard_library`` as follows::
 
     from future.standard_library import import_, from_import
-    
+
     http = import_('http.client')
     urllib = import_('urllib.request')
 
@@ -120,12 +120,12 @@ active for the life of a process unless removed.)
 .. importing the ``future.moves`` or ``future.backports`` modules unintentionally.
 .. Code such as this will then fall through to using the Py2 standard library
 .. modules on Py2::
-.. 
+..
 ..     try:
 ..         from http.client import HTTPConnection
 ..     except ImportError:
 ..         from httplib import HTTPConnection
-.. 
+..
 .. **Requests**: The above snippet is from the `requests
 .. <http://docs.python-requests.org>`_ library. As of v0.12, the
 .. ``future.standard_library`` import hooks are compatible with Requests.
@@ -133,11 +133,9 @@ active for the life of a process unless removed.)
 
 .. If you wish to avoid changing every reference of ``http.client`` to
 .. ``http_client`` in your code, an alternative is this::
-.. 
+..
 ..     from future.standard_library import http
 ..     from future.standard_library.http import client as _client
 ..     http.client = client
 
 .. but it has the advantage that it can be used by automatic translation scripts such as ``futurize`` and ``pasteurize``.
-
-
diff --git a/docs/open_function.rst b/docs/open_function.rst
index 656c91278796e2e877598b5439b6a67650ee466c..7915d8a8db1df9684bd45de3d8243db12710f791 100644
--- a/docs/open_function.rst
+++ b/docs/open_function.rst
@@ -5,7 +5,7 @@ open()
 
 The Python 3 builtin :func:`open` function for opening files returns file
 contents as (unicode) strings unless the binary (``b``) flag is passed, as in::
-    
+
     open(filename, 'rb')
 
 in which case its methods like :func:`read` return Py3 :class:`bytes` objects.
@@ -13,7 +13,7 @@ in which case its methods like :func:`read` return Py3 :class:`bytes` objects.
 On Py2 with ``future`` installed, the :mod:`builtins` module provides an
 ``open`` function that is mostly compatible with that on Python 3 (e.g. it
 offers keyword arguments like ``encoding``). This maps to the ``open`` backport
-available in the standard library :mod:`io` module on Py2.6 and Py2.7.
+available in the standard library :mod:`io` module on Py2.7.
 
 One difference to be aware of between the Python 3 ``open`` and
 ``future.builtins.open`` on Python 2 is that the return types of methods such
@@ -37,4 +37,3 @@ cast it explicitly as follows::
     assert data[4] == 13     # integer
     # Raises TypeError:
     # data + u''
-
diff --git a/docs/other/lessons.txt b/docs/other/lessons.txt
index 5794f496ff5d4cf40ccd5c6ef45c1f3fcd4a882d..ede523cb0a30b40114a9123839ac230bc95bc0ea 100644
--- a/docs/other/lessons.txt
+++ b/docs/other/lessons.txt
@@ -30,7 +30,7 @@ Python 2:
 Python 3:
 	>>> array.array(b'b')
 	TypeError: must be a unicode character, not bytes
-	
+
 	>>> array.array(u'b')
 	array('b')
 
@@ -47,5 +47,3 @@ Running test_bytes.py from Py3 on Py2 (after fixing imports) gives this:
 Ran 203 tests in 0.209s
 
 FAILED (failures=31, errors=55, skipped=1)
-
-
diff --git a/docs/other/upload_future_docs.sh b/docs/other/upload_future_docs.sh
index 006a45a99f6ab791bb4afa04c2a73ceed4631b2d..d5c272d243618c8b9f642eec79bdf24acbe9342a 100644
--- a/docs/other/upload_future_docs.sh
+++ b/docs/other/upload_future_docs.sh
@@ -21,4 +21,3 @@ unzip -o ~/python-future-html-docs.zip
 chmod a+r * html/* html/_static/*
 cp ~/cheatsheet.pdf ./html/compatible_idioms.pdf
 cp ~/cheatsheet.pdf ./html/cheatsheet.pdf
-
diff --git a/docs/other/useful_links.txt b/docs/other/useful_links.txt
index 8dec2f9b14f4c7802155c0751089033ab32e5f05..abb9684919812569dbb4407ad17fe22e19e30fdb 100644
--- a/docs/other/useful_links.txt
+++ b/docs/other/useful_links.txt
@@ -23,7 +23,7 @@ http://lucumr.pocoo.org/2011/12/7/thoughts-on-python3/
 http://python3porting.com/fixers.html
 http://washort.twistedmatrix.com/2010/11/unicode-in-python-and-how-to-prevent-it.html
 http://docs.python.org/release/3.0.1/whatsnew/3.0.html
-https://pypi.python.org/pypi/unicode-nazi
+https://pypi.org/project/unicode-nazi/
 http://www.rmi.net/~lutz/strings30.html
 
 "Porting your code to Python 3": Alexandre Vassalotti: peadrop.com/slides/mp5.pdf
@@ -43,7 +43,7 @@ python-modernize: https://github.com/mitsuhiko/python-modernize
 
 2to3 docs describing the different fixers: http://docs.python.org/2/library/2to3.html
 
-Injecting code into running Python processes (hopefully not needed): https://pypi.python.org/pypi/pyrasite/2.0
+Injecting code into running Python processes (hopefully not needed): https://pypi.org/project/pyrasite/2.0/
 
 Withdrawn PEP to help with the Py3k standard library transition: http://www.peps.io/364/
 
@@ -52,7 +52,7 @@ Import hooks
 http://www.peps.io/302/
 "Hacking Python imports ... for fun and profit": blog post from 2012-05: http://xion.org.pl/2012/05/06/hacking-python-imports/
 
-Full importlib backport to Py2: https://pypi.python.org/pypi/backport_importlib/0...1
+Full importlib backport to Py2: https://pypi.org/project/backport_importlib/0...1/
 
 Python 2.7 importlib subset: http://docs.python.org/2/whatsnew/2.7.html#importlib-section
 
@@ -78,7 +78,7 @@ PEPs: 358, 3112, 3137, 3138
 http://python3porting.com/noconv.html#unicode-section
 Unicode literals u'...' back in Python 3.3: http://www.python.org/dev/peps/pep-0414/
 https://github.com/django/django/blob/master/django/utils/encoding.py
-https://pypi.python.org/pypi/unicode-nazi
+https://pypi.org/project/unicode-nazi/
 http://docs.python.org/3/library/stdtypes.html#bytes-methods
 http://wolfprojects.altervista.org/talks/unicode-and-python-3/
 Buffer protocol (which bytes and bytes-like objects obey): http://docs.python.org/3.3/c-api/buffer.html#bufferobjects
@@ -86,7 +86,7 @@ Buffer protocol (which bytes and bytes-like objects obey): http://docs.python.or
 
 Python's future
 ----------------
-https://ncoghlan_devs-python-notes.readthedocs.org/en/latest/python3/questions_and_answers.html
+https://ncoghlan-devs-python-notes.readthedocs.io/en/latest/python3/questions_and_answers.html
 
 http://www.ironfroggy.com/software/i-am-worried-about-the-future-of-python
 
@@ -104,8 +104,7 @@ Also: typecheck module on PyPI
 To categorize
 -------------
 
-https://pypi.python.org/pypi/awkwardduet/1.1a4
+https://pypi.org/project/awkwardduet/1.1a4/
 https://github.com/campadrenalin/persei/blob/master/persei.py
 http://slideshare.net/dabeaz/mastering-python-3-io
 http://rmi.net/~lutz/strings30.html
-
diff --git a/docs/overview.rst b/docs/overview.rst
index 0aa732a1d08f1a63e4d354685cbaad115682c5a7..72a33558153fb57def85612b021ec596ef2a51b9 100644
--- a/docs/overview.rst
+++ b/docs/overview.rst
@@ -1,2 +1 @@
 .. include:: ../README.rst
-
diff --git a/docs/pasteurize.rst b/docs/pasteurize.rst
index dc434759b7f7b3ddaaa58c931e2fad8046066b11..070b5d1a838caaf32388f57a5a3bec3eaac0c4f5 100644
--- a/docs/pasteurize.rst
+++ b/docs/pasteurize.rst
@@ -4,20 +4,20 @@
 ----------------------------
 
 Running ``pasteurize -w mypy3module.py`` turns this Python 3 code::
-    
+
     import configparser
     import copyreg
-    
+
     class Blah:
         pass
     print('Hello', end=None)
 
 into this code which runs on both Py2 and Py3::
-    
+
     from __future__ import print_function
     from future import standard_library
     standard_library.install_hooks()
-    
+
     import configparser
     import copyreg
 
@@ -26,11 +26,11 @@ into this code which runs on both Py2 and Py3::
     print('Hello', end=None)
 
 Notice that both ``futurize`` and ``pasteurize`` create explicit new-style
-classes that inherit from ``object`` on both Python versions, and both 
+classes that inherit from ``object`` on both Python versions, and both
 refer to stdlib modules (as well as builtins) under their Py3 names.
 
 Note also that the ``configparser`` module is a special case; there is a full
-backport available on PyPI (https://pypi.python.org/pypi/configparser), so, as
+backport available on PyPI (https://pypi.org/project/configparser/), so, as
 of v0.16.0, ``python-future`` no longer provides a ``configparser`` package
 alias. To use the resulting code on Py2, install the ``configparser`` backport
 with ``pip install configparser`` or by adding it to your ``requirements.txt``
@@ -43,5 +43,3 @@ file.
 - extended tuple unpacking (PEP 3132)
 
 To handle function annotations (PEP 3107), see :ref:`func_annotations`.
-
-
diff --git a/docs/quickstart.rst b/docs/quickstart.rst
index b0d5900f1f34bda92f8dfa24af95d2a229db563b..a5e464f9f40e56a9543cfc68a91c8067fa836dd7 100644
--- a/docs/quickstart.rst
+++ b/docs/quickstart.rst
@@ -19,16 +19,6 @@ To install the latest stable version, type::
 If you would prefer the latest development version, it is available `here
 <https://github.com/PythonCharmers/python-future>`_.
 
-On Python 2.6, three packages containing backports of standard library modules
-in Python 2.7+ are needed for small parts of the code::
-
-    pip install importlib       # for future.standard_library.import_ function only
-    pip install unittest2       # to run the test suite
-    pip install argparse        # for the backported http.server module from Py3.3
-
-Unless these features are used on Python 2.6 (only), ``future`` has no
-dependencies.
-
 
 If you are writing code from scratch
 ------------------------------------
@@ -40,7 +30,7 @@ The easiest way is to start each new module with these lines::
     from builtins import *
 
 Then write standard Python 3 code. The :mod:`future` package will
-provide support for running your code on Python 2.6, 2.7, and 3.3+ mostly
+provide support for running your code on Python 2.7, and 3.4+ mostly
 unchanged.
 
 - For explicit import forms, see :ref:`explicit-imports`.
@@ -66,7 +56,7 @@ module::
 
     from future import standard_library
     standard_library.install_aliases()
-    
+
 and converts several Python 3-only constructs (like keyword-only arguments) to a
 form compatible with both Py3 and Py2. Most remaining Python 3 code should
 simply work on Python 2.
@@ -93,7 +83,7 @@ Standard library reorganization
 :mod:`future` supports the standard library reorganization (PEP 3108) via
 one of several mechanisms, allowing most moved standard library modules
 to be accessed under their Python 3 names and locations in Python 2::
-    
+
     from future import standard_library
     standard_library.install_aliases()
 
@@ -101,7 +91,7 @@ to be accessed under their Python 3 names and locations in Python 2::
     import socketserver
     import queue
     from collections import UserDict, UserList, UserString
-    from collections import Counter, OrderedDict, ChainMap   # even on Py2.6
+    from collections import ChainMap  # even on Py2.7
     from itertools import filterfalse, zip_longest
 
     import html
@@ -136,7 +126,7 @@ upon import. First, install the Python 2-only package into your Python 3
 environment::
 
     $ pip3 install mypackagename --no-compile   # to ignore SyntaxErrors
-    
+
 (or use ``pip`` if this points to your Py3 environment.)
 
 Then add the following code at the top of your (Py3 or Py2/3-compatible)
diff --git a/docs/reference.rst b/docs/reference.rst
index 4e0520142d8b7d4522eb9612aade9a7f7dd36a1f..d9ac5e126197039aefac800f92b6e42f5d9b8517 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -63,20 +63,19 @@ Forward-ported types from Python 2
 .. bytes
 .. -----
 .. .. automodule:: future.types.newbytes
-.. 
+..
 .. dict
 .. -----
 .. .. automodule:: future.types.newdict
-.. 
+..
 .. int
 .. ---
 .. .. automodule:: future.builtins.backports.newint
-.. 
+..
 .. range
 .. -----
 .. .. automodule:: future.types.newrange
-.. 
+..
 .. str
 .. ---
 .. .. automodule:: future.types.newstr
-
diff --git a/docs/roadmap.rst b/docs/roadmap.rst
index 8ef317c466ecfdcec41c47e5a8203ab78228afcb..c5020d5e7c264c86c4be54d5ea49f289ff496747 100644
--- a/docs/roadmap.rst
+++ b/docs/roadmap.rst
@@ -12,7 +12,7 @@ futurize script
 
       - Compatible metaclass syntax on Py3
       - Explicit inheritance from object on Py3
-    
+
    - Bold might make assumptions about which strings on Py2 should be
      unicode strings and which should be bytestrings.
 
@@ -44,4 +44,3 @@ Experimental:
   should import a custom str is a Py3 str-like object which inherits from unicode and
   removes the decode() method and has any other Py3-like behaviours
   (possibly stricter casting?)
-
diff --git a/docs/standard_library_imports.rst b/docs/standard_library_imports.rst
index e0c87746c45e122d52d4f870b908327c6e0dea7e..60442541c00490f9a4e5486b0b93fd8f938a53dc 100644
--- a/docs/standard_library_imports.rst
+++ b/docs/standard_library_imports.rst
@@ -78,14 +78,14 @@ complete list is here::
     import _thread
 
 Note that, as of v0.16.0, ``python-future`` no longer includes an alias for the
-``configparser`` module because a full backport exists (see https://pypi.python.org/pypi/configparser). 
+``configparser`` module because a full backport exists (see https://pypi.org/project/configparser/).
 
 .. _list-standard-library-refactored:
 
 Aliased imports
 ~~~~~~~~~~~~~~~
 
-The following 14 modules were refactored or extended from Python 2.6/2.7 to 3.x
+The following 14 modules were refactored or extended from Python 2.7 to 3.x
 but were neither renamed in Py3.x nor were the new APIs backported to Py2.x.
 This precludes compatibility interfaces that work out-of-the-box. Instead, the
 ``future`` package makes the Python 3.x APIs available on Python 2.x as
@@ -129,22 +129,16 @@ HTTPS (as of 2015-09-11) because the SSL support changed considerably in Python
 Backports also exist of the following features from Python 3.4:
 
 - ``math.ceil`` returns an int on Py3
-- ``collections.OrderedDict``  (for Python 2.6)
-- ``collections.Counter``      (for Python 2.6)
-- ``collections.ChainMap``     (for all versions prior to Python 3.3)
-- ``itertools.count``          (for Python 2.6, with step parameter)
-- ``subprocess.check_output``  (for Python 2.6)
-- ``reprlib.recursive_repr``   (for Python 2.6 and 2.7)
+- ``collections.ChainMap``     (for 2.7)
+- ``reprlib.recursive_repr``   (for 2.7)
 
-These can then be imported on Python 2.6+ as follows::
+These can then be imported on Python 2.7+ as follows::
 
     from future.standard_library import install_aliases
     install_aliases()
 
     from math import ceil      # now returns an int
-    from collections import Counter, OrderedDict, ChainMap
-    from itertools import count
-    from subprocess import check_output
+    from collections import ChainMap
     from reprlib import recursive_repr
 
 
@@ -158,21 +152,12 @@ available independently of the python-future project::
     import singledispatch             # pip install singledispatch
     import pathlib                    # pip install pathlib
 
-A few modules from Python 3.4 and 3.3 are also available in the ``backports``
+A few modules from Python 3.4 are also available in the ``backports``
 package namespace after ``pip install backports.lzma`` etc.::
 
     from backports import lzma
     from backports import functools_lru_cache as lru_cache
 
-The following Python 2.6 backports of standard library packages from Python 2.7+
-are also available::
-
-    import argparse                   # pip install argparse
-    import importlib                  # pip install importlib
-    import unittest2 as unittest      # pip install unittest2
-
-These are included in Python 2.7 and Python 3.x.
-
 
 Included full backports
 -----------------------
@@ -187,11 +172,10 @@ standard library to Python 2.x are also available in ``future.backports``::
     urllib
     xmlrpc.client
     xmlrpc.server
- 
+
 The goal for these modules, unlike the modules in the ``future.moves`` package
 or top-level namespace, is to backport new functionality introduced in Python
 3.3.
 
 If you need the full backport of one of these packages, please open an issue `here
 <https://github.com/PythonCharmers/python-future>`_.
-
diff --git a/docs/stdlib_incompatibilities.rst b/docs/stdlib_incompatibilities.rst
index e512925364916af2fe4b3fab31f971371ae02776..5f2217d21d8109599c66d65d2bdd8b94ee6acb0e 100644
--- a/docs/stdlib_incompatibilities.rst
+++ b/docs/stdlib_incompatibilities.rst
@@ -33,14 +33,14 @@ platform string: unicode string on Python 3, byte string on Python 2.
 Python 2::
     >>> array.array(b'b')
     array.array(b'b')
-    
+
     >>> array.array(u'u')
     TypeError: must be char, not unicode
 
 Python 3::
     >>> array.array(b'b')
     TypeError: must be a unicode character, not bytes
-    
+
     >>> array.array(u'b')
     array('b')
 
@@ -54,9 +54,12 @@ You can use the following code on both Python 3 and Python 2::
     import array
 
     # ...
-    
+
     a = array.array(bytes_to_native_str(b'b'))
 
+This was `fixed in Python 2.7.11
+<https://hg.python.org/cpython/file/6d1b6a68f775/Misc/NEWS#l233>`_.
+Since then, ``array.array()`` now also accepts unicode format typecode.
 
 .. _stdlib-array-read:
 
@@ -93,7 +96,7 @@ required a native string as its format argument. For example::
 
     >>> from __future__ import unicode_literals
     >>> from struct import pack
-    >>> pack('<4H2I', version, rec_type, build, year, file_hist_flags, ver_can_read) 
+    >>> pack('<4H2I', version, rec_type, build, year, file_hist_flags, ver_can_read)
 
 raised ``TypeError: Struct() argument 1 must be string, not unicode``.
 
@@ -101,4 +104,3 @@ This was `fixed in Python 2.7.7
 <https://hg.python.org/cpython/raw-file/f89216059edf/Misc/NEWS>`_.
 Since then, ``struct.pack()`` now also accepts unicode format
 strings.
-
diff --git a/docs/str_object.rst b/docs/str_object.rst
index 722d77477c3254b822e54698999ade3b2ae4a610..4c5257a04b202aaa1db735cea2573acf50f079b7 100644
--- a/docs/str_object.rst
+++ b/docs/str_object.rst
@@ -67,13 +67,13 @@ they are unicode. (See ``posixpath.py``.) Another example is the
 
 
 .. For example, this is permissible on Py2::
-.. 
+..
 ..     >>> u'u' > 10
 ..     True
-.. 
+..
 ..     >>> u'u' <= b'u'
 ..     True
-.. 
+..
 .. On Py3, these raise TypeErrors.
 
 In most other ways, these :class:`builtins.str` objects on Py2 have the
@@ -97,4 +97,3 @@ identically on Python 2.x and 3.x::
 This feature is in alpha. Please leave feedback `here
 <https://github.com/PythonCharmers/python-future/issues>`_ about whether this
 works for you.
-
diff --git a/docs/translation.rst b/docs/translation.rst
index e59c6676fb54802271ea8dec02b48da49b0f2186..49f558b0b3d4bbaed052b0cdcc8a86f166664d5b 100644
--- a/docs/translation.rst
+++ b/docs/translation.rst
@@ -19,10 +19,10 @@ Here is how to use it::
 
     $ pip3 install plotrique==0.2.5-7 --no-compile   # to ignore SyntaxErrors
     $ python3
-    
+
 Then pass in a whitelist of module name prefixes to the
 ``past.autotranslate()`` function. Example::
-    
+
     >>> from past import autotranslate
     >>> autotranslate(['plotrique'])
     >>> import plotrique
@@ -40,19 +40,19 @@ This will translate, import and run Python 2 code such as the following::
 
     # Print statements are translated transparently to functions:
     print 'Hello from a print statement'
-     
+
     # xrange() is translated to Py3's range():
     total = 0
     for i in xrange(10):
         total += i
     print 'Total is: %d' % total
-    
+
     # Dictionary methods like .keys() and .items() are supported and
     # return lists as on Python 2:
     d = {'a': 1, 'b': 2}
     assert d.keys() == ['a', 'b']
     assert isinstance(d.items(), list)
-    
+
     # Functions like range, reduce, map, filter also return lists:
     assert isinstance(range(10), list)
 
@@ -72,7 +72,7 @@ This will translate, import and run Python 2 code such as the following::
 
 The attributes of the module are then accessible normally from Python 3.
 For example::
-    
+
     # This Python 3 code works
     >>> type(mypy2module.d)
     builtins.dict
@@ -110,5 +110,3 @@ Known limitations of ``past.translation``
 
 Please report any bugs you find on the ``python-future`` `bug tracker
 <https://github.com/PythonCharmers/python-future/>`_.
-
-
diff --git a/docs/unicode_literals.rst b/docs/unicode_literals.rst
index 7af644c8d5171f75f9e2e936b15824b508cc4eba..7252e4d6b0d391cab76677085cf93d8c1d7cdd14 100644
--- a/docs/unicode_literals.rst
+++ b/docs/unicode_literals.rst
@@ -1,4 +1,3 @@
-
 .. _unicode-literals:
 
 Should I import unicode_literals?
@@ -28,7 +27,7 @@ Benefits
 1. String literals are unicode on Python 3. Making them unicode on Python 2
    leads to more consistency of your string types across the two
    runtimes. This can make it easier to understand and debug your code.
-   
+
 2. Code without ``u''`` prefixes is cleaner, one of the claimed advantages
    of Python 3. Even though some unicode strings would require a function
    call to invert them to native strings for some Python 2 APIs (see
@@ -57,7 +56,7 @@ Drawbacks
    of the Linux kernel.)
 
 .. This is a larger-scale change than adding explicit ``u''`` prefixes to
-..  all strings that should be Unicode. 
+..  all strings that should be Unicode.
 
 2. Changing to ``unicode_literals`` will likely introduce regressions on
    Python 2 that require an initial investment of time to find and fix. The
@@ -82,7 +81,7 @@ Drawbacks
    change the return type of the ``unix_style_path`` function from ``str`` to
    ``unicode`` in the user code, which is difficult to anticipate and probably
    unintended.
-   
+
    The counter-argument is that this code is broken, in a portability
    sense; we see this from Python 3 raising a ``TypeError`` upon passing the
    function a byte-string. The code needs to be changed to make explicit
@@ -122,16 +121,16 @@ Drawbacks
 
        >>> def f():
        ...     u"Author: Martin von Löwis"
-       
+
        >>> help(f)
-       
+
        /Users/schofield/Install/anaconda/python.app/Contents/lib/python2.7/pydoc.pyc in pipepager(text, cmd)
           1376     pipe = os.popen(cmd, 'w')
           1377     try:
        -> 1378         pipe.write(text)
           1379         pipe.close()
           1380     except IOError:
-       
+
        UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 71: ordinal not in range(128)
 
 See `this Stack Overflow thread
@@ -156,18 +155,18 @@ codebase.:
     ``u''`` prefixes for unicode literals on Python 3.3+] is at odds with
     the porting philosophy I've applied to Django, and why I would have
     vetoed taking advantage of it.
-    
+
     "I believe that aiming for a Python 2 codebase with Python 3
     compatibility hacks is a counter-productive way to port a project. You
     end up with all the drawbacks of Python 2 (including the legacy `u`
     prefixes) and none of the advantages Python 3 (especially the sane
     string handling).
-    
+
     "Working to write Python 3 code, with legacy compatibility for Python
     2, is much more rewarding. Of course it takes more effort, but the
     results are much cleaner and much more maintainable. It's really about
     looking towards the future or towards the past.
-    
+
     "I understand the reasons why PEP 414 was proposed and why it was
     accepted. It makes sense for legacy software that is minimally
     maintained. I hope nobody puts Django in this category!"
@@ -182,19 +181,17 @@ Against ``unicode_literals``
     where there are unicode characters in the filesystem path."
 
     -- Armin Ronacher
-    
+
     "+1 from me for avoiding the unicode_literals future, as it can have
     very strange side effects in Python 2.... This is one of the key
     reasons I backed Armin's PEP 414."
 
     -- Nick Coghlan
-    
+
     "Yeah, one of the nuisances of the WSGI spec is that the header values
     IIRC are the str or StringType on both py2 and py3. With
     unicode_literals this causes hard-to-spot bugs, as some WSGI servers
     might be more tolerant than others, but usually using unicode in python
     2 for WSGI headers will cause the response to fail."
-    
-    -- Antti Haapala
-
 
+    -- Antti Haapala
diff --git a/docs/upgrading.rst b/docs/upgrading.rst
index 098d42cfc792c6e52a5c1ccba61d817fd5f48459..0d8afca6e784eaf1e9753203154efb9f2a46b3f2 100644
--- a/docs/upgrading.rst
+++ b/docs/upgrading.rst
@@ -10,4 +10,3 @@ We strive to support compatibility between versions of ``python-future``. Part o
 
 Upgrading to v0.12
 ==================
-
diff --git a/docs/utilities.rst b/docs/utilities.rst
index 24170e1221a0c42d0c581a5c5f660e0450bcd5a0..e3f1e9c6d07d93ad3742dfd8f4d30b7558a92555 100644
--- a/docs/utilities.rst
+++ b/docs/utilities.rst
@@ -46,4 +46,3 @@ Examples::
     # prints ['H', 'E', 'L', 'L', 'O']
 
 On Python 3 these decorators are no-ops.
-
diff --git a/docs/what_else.rst b/docs/what_else.rst
index 655d953d883c629593a13fa78f4c1bffdab7f204..51f198698a4dbb5a9fc2fea258a198340ea25821 100644
--- a/docs/what_else.rst
+++ b/docs/what_else.rst
@@ -23,4 +23,3 @@ compatible code.
 .. include:: metaclasses.rst
 
 ..
-
diff --git a/docs/whatsnew.rst b/docs/whatsnew.rst
index 582b506b27f414e7e7232580468c01b110f509a0..6879052720b61a2669bfbc22213343480b2002da 100644
--- a/docs/whatsnew.rst
+++ b/docs/whatsnew.rst
@@ -3,14 +3,37 @@
 What's New
 **********
 
-.. _whats-new-0.16.x:
+What's new in version 0.17.1 (2019-10-30)
+=========================================
+This release address a packaging error because of an erroneous declaration that
+any built wheels are universal.
+
+What's new in version 0.17.0 (2018-10-19)
+=========================================
+
+This is a major bug-fix release, including:
+
+- Fix ``from collections import ChainMap`` after install_aliases() (issue #226)
+- Fix multiple import from ``__future__`` bug in futurize (issue #113)
+- Add support for proper %s formatting of newbytes
+- Properly implement iterator protocol for newrange object
+- Fix ``past.translation`` on read-only file systems
+- Fix Tkinter import bug introduced in Python 2.7.4 (issue #262)
+- Correct TypeError to ValueError in a specific edge case for newrange
+- Support inequality tests betwen newstrs and newbytes
+- Add type check to __get__ in newsuper
+- Fix fix_divsion_safe to support better conversion of complex expressions, and
+  skip obvious float division.
+
+As well as a number of corrections to a variety of documentation, and updates to
+test infrastructure.
 
-What's new in version 0.16.0 (2016-09-22)
+What's new in version 0.16.0 (2016-10-27)
 ==========================================
 
 This release removes the ``configparser`` package as an alias for
 ``ConfigParser`` on Py2 to improve compatibility with the backported
-`configparser package <https://pypi.python.org/pypi/configparser>`. Previously
+`configparser package <https://pypi.org/project/configparser/>`. Previously
 ``python-future`` and the PyPI ``configparser`` backport clashed, causing
 various compatibility issues. (Issues #118, #181)
 
@@ -26,18 +49,18 @@ effect on your system.
 This releases also fixes these bugs:
 
 - Fix ``newbytes`` constructor bug. (Issue #163)
-- Fix semantics of `bool()` with `newobject`. (Issue #211)
-- Fix `standard_library.install_aliases()` on PyPy. (Issue #205)
-- Fix assertRaises for `pow` and `compile` on Python 3.5. (Issue #183)
-- Fix return argument of `future.utils.ensure_new_type` if conversion to
+- Fix semantics of ``bool()`` with ``newobject``. (Issue #211)
+- Fix ``standard_library.install_aliases()`` on PyPy. (Issue #205)
+- Fix assertRaises for ``pow`` and ``compile``` on Python 3.5. (Issue #183)
+- Fix return argument of ``future.utils.ensure_new_type`` if conversion to
   new type does not exist. (Issue #185)
-- Add missing `cmp_to_key` for Py2.6. (Issue #189)
-- Allow the `old_div` fixer to be disabled. (Issue #190)
+- Add missing ``cmp_to_key`` for Py2.6. (Issue #189)
+- Allow the ``old_div`` fixer to be disabled. (Issue #190)
 - Improve compatibility with Google App Engine. (Issue #231)
-- Add some missing imports to the `tkinter` and `tkinter.filedialog`
+- Add some missing imports to the ``tkinter`` and ``tkinter.filedialog``
   package namespaces. (Issues #212 and #233)
-- Fix ``raise_from`` on PY3 when the exception cannot be recreated from
-  its repr. (Issues #213 and #235, fix provided by Varriount)
+- More complete implementation of ``raise_from`` on PY3. (Issues #141,
+  #213 and #235, fix provided by Varriount)
 
 
 What's new in version 0.15.2 (2015-09-11)
diff --git a/docs/why_python3.rst b/docs/why_python3.rst
index 37dc605ae2b74194eeaf160ad54d30a84d7b70c0..a4b535f491c45158a5c4517847363c62707e6682 100644
--- a/docs/why_python3.rst
+++ b/docs/why_python3.rst
@@ -56,11 +56,11 @@ Standard library:
 ~~~~~~~~~~~~~~~~~
 
 - SSL contexts in http.client
-- 
+-
 
 
 
 Non-arguments for Python 3
 ==========================
 
-- 
+-
diff --git a/futurize.py b/futurize.py
index 5f1a773245223c0f8cc7718cfb1e4fbc8bf05528..41080cf0073207a67717372486bc33f26781244b 100755
--- a/futurize.py
+++ b/futurize.py
@@ -13,7 +13,7 @@ also compatible with Py2 when using the ``future`` package.
 
 Licensing
 ---------
-Copyright 2013-2016 Python Charmers Pty Ltd, Australia.
+Copyright 2013-2018 Python Charmers Pty Ltd, Australia.
 The software is distributed under an MIT licence. See LICENSE.txt.
 """
 
diff --git a/pasteurize.py b/pasteurize.py
index db7931ab7432bcdc8135c968410c285d9213966b..c0bd7e09daa7bc1c32e7ea1c8bfcd4919c107883 100755
--- a/pasteurize.py
+++ b/pasteurize.py
@@ -12,7 +12,7 @@ also compatible with Py2 when using the ``future`` package.
 
 Licensing
 ---------
-Copyright 2013-2016 Python Charmers Pty Ltd, Australia.
+Copyright 2013-2018 Python Charmers Pty Ltd, Australia.
 The software is distributed under an MIT licence. See LICENSE.txt.
 """
 
diff --git a/requirements_py26.txt b/requirements_py26.txt
deleted file mode 100644
index 5b618903111af6c7c9baf021d3e6c9a4679e83f0..0000000000000000000000000000000000000000
--- a/requirements_py26.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-unittest2
-argparse     # for the http.server module
-importlib
-
diff --git a/setup.cfg b/setup.cfg
index 861a9f554263efb088d8636c4f17a30696e495ad..45df256ccc029ff3225faba998d2ca9c34aa2fe9 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,7 @@
+[metadata]
+license_file = LICENSE.txt
+
 [egg_info]
 tag_build = 
 tag_date = 0
-tag_svn_revision = 0
 
diff --git a/setup.py b/setup.py
index f168e90fea40f9b6028c0c230080ae669890c861..2f7b36a37ef925c7b439e978817e2623a2f2236a 100755
--- a/setup.py
+++ b/setup.py
@@ -78,18 +78,12 @@ PACKAGE_DATA = {'': [
                      'LICENSE.txt',
                      'futurize.py',
                      'pasteurize.py',
-                     'discover_tests.py',
                      'check_rst.sh',
                      'TESTING.txt',
                     ],
                 'tests': ['*.py'],
                 }
 
-REQUIRES = []
-TEST_REQUIRES = []
-if sys.version_info[:2] == (2, 6):
-    REQUIRES += ['importlib', 'argparse']
-    TEST_REQUIRES += ['unittest2']
 import src.future
 VERSION = src.future.__version__
 DESCRIPTION = "Clean single-source support for Python 3 and 2"
@@ -101,12 +95,15 @@ LICENSE = "MIT"
 KEYWORDS = "future past python3 migration futurize backport six 2to3 modernize pasteurize 3to2"
 CLASSIFIERS = [
     "Programming Language :: Python",
+    "Programming Language :: Python :: 2",
     "Programming Language :: Python :: 2.6",
     "Programming Language :: Python :: 2.7",
     "Programming Language :: Python :: 3",
     "Programming Language :: Python :: 3.3",
     "Programming Language :: Python :: 3.4",
     "Programming Language :: Python :: 3.5",
+    "Programming Language :: Python :: 3.6",
+    "Programming Language :: Python :: 3.7",
     "License :: OSI Approved",
     "License :: OSI Approved :: MIT License",
     "Development Status :: 4 - Beta",
@@ -179,9 +176,7 @@ setup(name=NAME,
       packages=PACKAGES,
       package_data=PACKAGE_DATA,
       include_package_data=True,
-      install_requires=REQUIRES,
+      python_requires=">=2.6, !=3.0.*, !=3.1.*, !=3.2.*",
       classifiers=CLASSIFIERS,
-      test_suite = "discover_tests",
-      tests_require=TEST_REQUIRES,
       **setup_kwds
      )
diff --git a/src/future.egg-info/PKG-INFO b/src/future.egg-info/PKG-INFO
index f1f3b672448f0aa754b5b47479e85f89ab4951a6..88b577ab0e8dee9988c2ec8ef16c74dd7363874c 100644
--- a/src/future.egg-info/PKG-INFO
+++ b/src/future.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
 Name: future
-Version: 0.16.0
+Version: 0.17.1
 Summary: Clean single-source support for Python 3 and 2
 Home-page: https://python-future.org
 Author: Ed Schofield
@@ -84,20 +84,24 @@ Description:
         
         Licensing
         ---------
-        Copyright 2013-2016 Python Charmers Pty Ltd, Australia.
+        Copyright 2013-2018 Python Charmers Pty Ltd, Australia.
         The software is distributed under an MIT licence. See LICENSE.txt.
         
         
 Keywords: future past python3 migration futurize backport six 2to3 modernize pasteurize 3to2
 Platform: UNKNOWN
 Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2
 Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
 Classifier: Programming Language :: Python :: 3.3
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
 Classifier: License :: OSI Approved
 Classifier: License :: OSI Approved :: MIT License
 Classifier: Development Status :: 4 - Beta
 Classifier: Intended Audience :: Developers
+Requires-Python: >=2.6, !=3.0.*, !=3.1.*, !=3.2.*
diff --git a/src/future.egg-info/SOURCES.txt b/src/future.egg-info/SOURCES.txt
index 956519fe196651025b36ae6cdca87a4d00d398f5..02ac0a485822a3b4efc21f0dc4c81b5d67f367c6 100644
--- a/src/future.egg-info/SOURCES.txt
+++ b/src/future.egg-info/SOURCES.txt
@@ -4,11 +4,10 @@ MANIFEST.in
 README.rst
 TESTING.txt
 check_rst.sh
-discover_tests.py
 futurize.py
 pasteurize.py
 pytest.ini
-requirements_py26.txt
+setup.cfg
 setup.py
 docs/Makefile
 docs/automatic_conversion.rst
@@ -345,6 +344,7 @@ tests/test_future/test_buffer.py
 tests/test_future/test_builtins.py
 tests/test_future/test_builtins_explicit_import.py
 tests/test_future/test_bytes.py
+tests/test_future/test_chainmap.py
 tests/test_future/test_common_iterators.py
 tests/test_future/test_decorators.py
 tests/test_future/test_dict.py
diff --git a/src/future.egg-info/top_level.txt b/src/future.egg-info/top_level.txt
index 58f5843c6c613398a7a9cad8f562de3e7f61d314..c10cc6199b174d31054d689e2dc133e90d925863 100644
--- a/src/future.egg-info/top_level.txt
+++ b/src/future.egg-info/top_level.txt
@@ -1,4 +1,17 @@
+_dummy_thread
+_markupbase
+_thread
+builtins
+copyreg
 future
+html
+http
 libfuturize
 libpasteurize
 past
+queue
+reprlib
+socketserver
+tkinter
+winreg
+xmlrpc
diff --git a/src/future/__init__.py b/src/future/__init__.py
index 8139aa33a99b2072e0bc93dc1571b98387a65c93..f7a6fbebb1eaa7e9eb08aa877beb55a4e154890c 100644
--- a/src/future/__init__.py
+++ b/src/future/__init__.py
@@ -76,7 +76,7 @@ Credits
 
 Licensing
 ---------
-Copyright 2013-2016 Python Charmers Pty Ltd, Australia.
+Copyright 2013-2018 Python Charmers Pty Ltd, Australia.
 The software is distributed under an MIT licence. See LICENSE.txt.
 
 """
@@ -84,10 +84,10 @@ The software is distributed under an MIT licence. See LICENSE.txt.
 __title__ = 'future'
 __author__ = 'Ed Schofield'
 __license__ = 'MIT'
-__copyright__ = 'Copyright 2013-2016 Python Charmers Pty Ltd'
+__copyright__ = 'Copyright 2013-2018 Python Charmers Pty Ltd'
 __ver_major__ = 0
-__ver_minor__ = 16
-__ver_patch__ = 0
+__ver_minor__ = 17
+__ver_patch__ = 1
 __ver_sub__ = ''
 __version__ = "%d.%d.%d%s" % (__ver_major__, __ver_minor__,
                               __ver_patch__, __ver_sub__)
diff --git a/src/future/backports/html/__init__.py b/src/future/backports/html/__init__.py
index 837afce1ba7157bc5fe27c84a044dc34e791ead6..58e133fd4b497bd5c9a57598a7fca4706d96d74c 100644
--- a/src/future/backports/html/__init__.py
+++ b/src/future/backports/html/__init__.py
@@ -25,4 +25,3 @@ def escape(s, quote=True):
     if quote:
         return s.translate(_escape_map_full)
     return s.translate(_escape_map)
-
diff --git a/src/future/backports/html/entities.py b/src/future/backports/html/entities.py
index 6798187c6a80e3ccda7b27a99049630567cfd7b2..5c73f6923a9beb3e551ffca45f10bfc719893746 100644
--- a/src/future/backports/html/entities.py
+++ b/src/future/backports/html/entities.py
@@ -2512,4 +2512,3 @@ for (name, codepoint) in name2codepoint.items():
     entitydefs[name] = chr(codepoint)
 
 del name, codepoint
-
diff --git a/src/future/backports/html/parser.py b/src/future/backports/html/parser.py
index 7b8cdba6138ee0786637940087ad8adf38008937..fb652636d46d7d5bf40b5036a6ed831c59ef5c45 100644
--- a/src/future/backports/html/parser.py
+++ b/src/future/backports/html/parser.py
@@ -534,4 +534,3 @@ class HTMLParser(_markupbase.ParserBase):
 
         return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+;|\w{1,32};?))",
                       replaceEntities, s)
-
diff --git a/src/future/backports/misc.py b/src/future/backports/misc.py
index 31e713ae38e41cbe22cdcc1b323e33dda3e594ad..ef752078858446ad8cd778d7282d78118ac975f9 100644
--- a/src/future/backports/misc.py
+++ b/src/future/backports/misc.py
@@ -779,7 +779,7 @@ class ChainMap(MutableMapping):
 
     # Py2 compatibility:
     __nonzero__ = __bool__
-        
+
     @recursive_repr()
     def __repr__(self):
         return '{0.__class__.__name__}({1})'.format(
@@ -817,7 +817,7 @@ class ChainMap(MutableMapping):
         try:
             del self.maps[0][key]
         except KeyError:
-            raise KeyError('Key not found in the first mapping: {!r}'.format(key))
+            raise KeyError('Key not found in the first mapping: {0!r}'.format(key))
 
     def popitem(self):
         'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
@@ -831,7 +831,7 @@ class ChainMap(MutableMapping):
         try:
             return self.maps[0].pop(key, *args)
         except KeyError:
-            raise KeyError('Key not found in the first mapping: {!r}'.format(key))
+            raise KeyError('Key not found in the first mapping: {0!r}'.format(key))
 
     def clear(self):
         'Clear maps[0], leaving maps[1:] intact.'
diff --git a/src/future/backports/test/support.py b/src/future/backports/test/support.py
index b59c4ff73b1a0623c62c10963d62a42a42c77028..1999e208fec81fee9ad6cc44c594898ad8b8d781 100644
--- a/src/future/backports/test/support.py
+++ b/src/future/backports/test/support.py
@@ -666,7 +666,7 @@ TESTFN = "{0}_{1}_tmp".format(TESTFN, os.getpid())
 #     # First try printable and common characters to have a readable filename.
 #     # For each character, the encoding list are just example of encodings able
 #     # to encode the character (the list is not exhaustive).
-# 
+#
 #     # U+00E6 (Latin Small Letter Ae): cp1252, iso-8859-1
 #     '\u00E6',
 #     # U+0130 (Latin Capital Letter I With Dot Above): cp1254, iso8859_3
@@ -685,11 +685,11 @@ TESTFN = "{0}_{1}_tmp".format(TESTFN, os.getpid())
 #     '\u062A',
 #     # U+0E01 (Thai Character Ko Kai): cp874
 #     '\u0E01',
-# 
+#
 #     # Then try more "special" characters. "special" because they may be
 #     # interpreted or displayed differently depending on the exact locale
 #     # encoding and the font.
-# 
+#
 #     # U+00A0 (No-Break Space)
 #     '\u00A0',
 #     # U+20AC (Euro Sign)
@@ -702,7 +702,7 @@ TESTFN = "{0}_{1}_tmp".format(TESTFN, os.getpid())
 #     else:
 #         FS_NONASCII = character
 #         break
-# 
+#
 # # TESTFN_UNICODE is a non-ascii filename
 # TESTFN_UNICODE = TESTFN + "-\xe0\xf2\u0258\u0141\u011f"
 # if sys.platform == 'darwin':
@@ -712,7 +712,7 @@ TESTFN = "{0}_{1}_tmp".format(TESTFN, os.getpid())
 #     import unicodedata
 #     TESTFN_UNICODE = unicodedata.normalize('NFD', TESTFN_UNICODE)
 # TESTFN_ENCODING = sys.getfilesystemencoding()
-# 
+#
 # # TESTFN_UNENCODABLE is a filename (str type) that should *not* be able to be
 # # encoded by the filesystem encoding (in strict mode). It can be None if we
 # # cannot generate such filename.
@@ -745,7 +745,7 @@ TESTFN = "{0}_{1}_tmp".format(TESTFN, os.getpid())
 #         # File system encoding (eg. ISO-8859-* encodings) can encode
 #         # the byte 0xff. Skip some unicode filename tests.
 #         pass
-# 
+#
 # # TESTFN_UNDECODABLE is a filename (bytes type) that should *not* be able to be
 # # decoded from the filesystem encoding (in strict mode). It can be None if we
 # # cannot generate such filename (ex: the latin1 encoding can decode any byte
@@ -775,7 +775,7 @@ TESTFN = "{0}_{1}_tmp".format(TESTFN, os.getpid())
 #     except UnicodeDecodeError:
 #         TESTFN_UNDECODABLE = os.fsencode(TESTFN) + name
 #         break
-# 
+#
 # if FS_NONASCII:
 #     TESTFN_NONASCII = TESTFN + '-' + FS_NONASCII
 # else:
@@ -1667,15 +1667,15 @@ def run_unittest(*classes):
 # We don't have sysconfig on Py2.6:
 # #=======================================================================
 # # Check for the presence of docstrings.
-# 
+#
 # HAVE_DOCSTRINGS = (check_impl_detail(cpython=False) or
 #                    sys.platform == 'win32' or
 #                    sysconfig.get_config_var('WITH_DOC_STRINGS'))
-# 
+#
 # requires_docstrings = unittest.skipUnless(HAVE_DOCSTRINGS,
 #                                           "test requires docstrings")
-# 
-# 
+#
+#
 # #=======================================================================
 # doctest driver.
 
diff --git a/src/future/backports/urllib/parse.py b/src/future/backports/urllib/parse.py
index ada2f8bb4c115bc5092dfaff1ba7387783d06ed2..04e52d492586f921ac4fb80c4e34788fc02cf592 100644
--- a/src/future/backports/urllib/parse.py
+++ b/src/future/backports/urllib/parse.py
@@ -727,14 +727,14 @@ def quote_from_bytes(bs, safe='/'):
         return str('')
     ### For Python-Future:
     bs = bytes(bs)
-    ### 
+    ###
     if isinstance(safe, str):
         # Normalize 'safe' by converting to bytes and removing non-ASCII chars
         safe = str(safe).encode('ascii', 'ignore')
     else:
         ### For Python-Future:
         safe = bytes(safe)
-        ### 
+        ###
         safe = bytes([c for c in safe if c < 128])
     if not bs.rstrip(_ALWAYS_SAFE_BYTES + safe):
         return bs.decode()
diff --git a/src/future/builtins/__init__.py b/src/future/builtins/__init__.py
index 94011f9795fedfcc6a9c88f8760cea33e3310bd1..216465a155cc063f8ad1d015affea8389a1c163a 100644
--- a/src/future/builtins/__init__.py
+++ b/src/future/builtins/__init__.py
@@ -38,9 +38,9 @@ from future import utils
 if not utils.PY3:
     # We only import names that shadow the builtins on Py2. No other namespace
     # pollution on Py2.
-    
+
     # Only shadow builtins on Py2; no new names
-    __all__ = ['filter', 'map', 'zip', 
+    __all__ = ['filter', 'map', 'zip',
                'ascii', 'chr', 'hex', 'input', 'next', 'oct', 'open', 'pow',
                'round', 'super',
                'bytes', 'dict', 'int', 'list', 'object', 'range', 'str',
diff --git a/src/future/builtins/iterators.py b/src/future/builtins/iterators.py
index b82f29f2a011b8d59edd3202fd9e05c2f6f2ea33..dff651e0f46e8f45cb6591d7f69a75b7dcb192da 100644
--- a/src/future/builtins/iterators.py
+++ b/src/future/builtins/iterators.py
@@ -7,7 +7,7 @@ And then, for example::
 
     for i in range(10**15):
         pass
-    
+
     for (a, b) in zip(range(10**15), range(-10**15, 0)):
         pass
 
@@ -50,4 +50,3 @@ else:
     range = builtins.range
     zip = builtins.zip
     __all__ = []
-
diff --git a/src/future/builtins/newnext.py b/src/future/builtins/newnext.py
index 9364023aa28d698ab3c2fc5479d75864e864acd3..097638ac1120e632ec4586a9638ed174a71b704c 100644
--- a/src/future/builtins/newnext.py
+++ b/src/future/builtins/newnext.py
@@ -43,7 +43,7 @@ _SENTINEL = object()
 def newnext(iterator, default=_SENTINEL):
     """
     next(iterator[, default])
-    
+
     Return the next item from the iterator. If default is given and the iterator
     is exhausted, it is returned instead of raising StopIteration.
     """
@@ -68,4 +68,3 @@ def newnext(iterator, default=_SENTINEL):
 
 
 __all__ = ['newnext']
-
diff --git a/src/future/builtins/newround.py b/src/future/builtins/newround.py
index f59b35b325f74d06da0b45e5d3ff85b14a896c11..3943ebb6e32e062b43db6549326b37e6c9e28d4e 100644
--- a/src/future/builtins/newround.py
+++ b/src/future/builtins/newround.py
@@ -1,7 +1,7 @@
 """
 ``python-future``: pure Python implementation of Python 3 round().
 """
- 
+
 from future.utils import PYPY, PY26, bind_method
 
 # Use the decimal module for simplicity of implementation (and
@@ -12,13 +12,13 @@ from decimal import Decimal, ROUND_HALF_EVEN
 def newround(number, ndigits=None):
     """
     See Python 3 documentation: uses Banker's Rounding.
- 
+
     Delegates to the __round__ method if for some reason this exists.
- 
+
     If not, rounds a number to a given precision in decimal digits (default
     0 digits). This returns an int when called with one argument,
     otherwise the same type as the number. ndigits may be negative.
- 
+
     See the test_round method in future/tests/test_builtins.py for
     examples.
     """
@@ -28,7 +28,7 @@ def newround(number, ndigits=None):
         ndigits = 0
     if hasattr(number, '__round__'):
         return number.__round__(ndigits)
-    
+
     if ndigits < 0:
         raise NotImplementedError('negative ndigits not supported yet')
     exponent = Decimal('10') ** (-ndigits)
@@ -48,7 +48,7 @@ def newround(number, ndigits=None):
         return int(d)
     else:
         return float(d)
- 
+
 
 ### From Python 2.7's decimal.py. Only needed to support Py2.6:
 
diff --git a/src/future/builtins/newsuper.py b/src/future/builtins/newsuper.py
index a787f4bb9cb697f5b6861d4b67e0347f4683dc38..5d3402bd2f9286d4cb0712182dc667aa03d8b0d9 100644
--- a/src/future/builtins/newsuper.py
+++ b/src/future/builtins/newsuper.py
@@ -24,7 +24,7 @@ Excerpts from Ryan's docstring:
   "Of course, you can still explicitly pass in the arguments if you want
   to do something strange.  Sometimes you really do want that, e.g. to
   skip over some classes in the method resolution order.
-  
+
   "How does it work?  By inspecting the calling frame to determine the
   function object being executed and the object on which it's being
   called, and then walking the object's __mro__ chain to find out where
@@ -51,14 +51,14 @@ def newsuper(typ=_SENTINEL, type_or_obj=_SENTINEL, framedepth=1):
     #  Infer the correct call if used without arguments.
     if typ is _SENTINEL:
         # We'll need to do some frame hacking.
-        f = sys._getframe(framedepth)    
+        f = sys._getframe(framedepth)
 
         try:
             # Get the function's first positional argument.
             type_or_obj = f.f_locals[f.f_code.co_varnames[0]]
         except (IndexError, KeyError,):
             raise RuntimeError('super() used in a function with no args')
-        
+
         try:
             # Get the MRO so we can crawl it.
             mro = type_or_obj.__mro__
@@ -67,9 +67,9 @@ def newsuper(typ=_SENTINEL, type_or_obj=_SENTINEL, framedepth=1):
                 mro = type_or_obj.__class__.__mro__
             except AttributeError:
                 raise RuntimeError('super() used with a non-newstyle class')
-        
+
         #   A ``for...else`` block?  Yes!  It's odd, but useful.
-        #   If unfamiliar with for...else, see: 
+        #   If unfamiliar with for...else, see:
         #
         #       http://psung.blogspot.com/2007/12/for-else-in-python.html
         for typ in mro:
@@ -88,7 +88,7 @@ def newsuper(typ=_SENTINEL, type_or_obj=_SENTINEL, framedepth=1):
                             try:
                                 meth = meth.__func__
                             except AttributeError:
-                                meth = meth.__get__(type_or_obj)
+                                meth = meth.__get__(type_or_obj, typ)
                 except (AttributeError, TypeError):
                     continue
                 if meth.func_code is f.f_code:
@@ -98,7 +98,7 @@ def newsuper(typ=_SENTINEL, type_or_obj=_SENTINEL, framedepth=1):
             break    #  Found! Break out of the search loop.
         else:
             raise RuntimeError('super() called outside a method')
-    
+
     #  Dispatch to builtin super().
     if type_or_obj is not _SENTINEL:
         return _builtin_super(typ, type_or_obj)
@@ -112,4 +112,3 @@ def superm(*args, **kwds):
 
 
 __all__ = ['newsuper']
-
diff --git a/src/future/moves/test/support.py b/src/future/moves/test/support.py
index ab189f4060df907b617646c9192c6c6e4e13f54e..e9aa0f48f99c3f13541ddacbf70bc5f4b89bb820 100644
--- a/src/future/moves/test/support.py
+++ b/src/future/moves/test/support.py
@@ -8,4 +8,3 @@ else:
     __future_module__ = True
     with suspend_hooks():
         from test.test_support import *
-
diff --git a/src/future/moves/tkinter/__init__.py b/src/future/moves/tkinter/__init__.py
index bc50b4c60242359925e86b9da5a326fd5498abb4..e40829663ee77ecea75ef6fd2036f0d2d63f54d0 100644
--- a/src/future/moves/tkinter/__init__.py
+++ b/src/future/moves/tkinter/__init__.py
@@ -4,8 +4,24 @@ __future_module__ = True
 
 if not PY3:
     from Tkinter import *
-    from Tkinter import (_cnfmerge, _default_root, _flatten, _join, _setit,
-                         _splitdict, _stringify, _support_default_root, _test,
-                         _tkinter)
+    from Tkinter import (_cnfmerge, _default_root, _flatten,
+                          _support_default_root, _test,
+                         _tkinter, _setit)
+
+    try: # >= 2.7.4
+        from Tkinter import (_join) 
+    except ImportError: 
+        pass
+
+    try: # >= 2.7.4
+        from Tkinter import (_stringify)
+    except ImportError: 
+        pass
+
+    try: # >= 2.7.9
+        from Tkinter import (_splitdict)
+    except ImportError:
+        pass
+
 else:
     from tkinter import *
diff --git a/src/future/moves/tkinter/colorchooser.py b/src/future/moves/tkinter/colorchooser.py
index 5e7c97f4449dffd07008dba88cd6bfc06cab8413..6dde6e8d300184857b92eb94a7e83ac1fe14d904 100644
--- a/src/future/moves/tkinter/colorchooser.py
+++ b/src/future/moves/tkinter/colorchooser.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The tkColorChooser module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/future/moves/tkinter/commondialog.py b/src/future/moves/tkinter/commondialog.py
index 7747a0ba0b05d8140976907df9d64202702d3e37..eb7ae8d6076170bd3a72ca5c37a3a3d80c03afa2 100644
--- a/src/future/moves/tkinter/commondialog.py
+++ b/src/future/moves/tkinter/commondialog.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The tkCommonDialog module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/future/moves/tkinter/constants.py b/src/future/moves/tkinter/constants.py
index 99216f33d0a08a0d66a3aff9517ffb1a58cb9dba..ffe098152f11fb8310f96754d260154dcf7ab41c 100644
--- a/src/future/moves/tkinter/constants.py
+++ b/src/future/moves/tkinter/constants.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The Tkconstants module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/future/moves/tkinter/dialog.py b/src/future/moves/tkinter/dialog.py
index a5b777815a3a39ba3e0a906c2cab5856b0471e7c..113370ca2cbf7dd5beff1f510951c95bbe142a91 100644
--- a/src/future/moves/tkinter/dialog.py
+++ b/src/future/moves/tkinter/dialog.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The Dialog module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/future/moves/tkinter/dnd.py b/src/future/moves/tkinter/dnd.py
index 748b111a2b619d5e2d4ac62f51f924bd8833dcd6..1ab437917d9e2cb0253846f6023031fea821adcd 100644
--- a/src/future/moves/tkinter/dnd.py
+++ b/src/future/moves/tkinter/dnd.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The Tkdnd module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/future/moves/tkinter/filedialog.py b/src/future/moves/tkinter/filedialog.py
index 35e21ac0eb19de613107633c378df64ecf2dc080..973923e2c803764dc0c3aa5c9d5b30346c39da7d 100644
--- a/src/future/moves/tkinter/filedialog.py
+++ b/src/future/moves/tkinter/filedialog.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The FileDialog module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/future/moves/tkinter/font.py b/src/future/moves/tkinter/font.py
index 63d86dc73c02c12bfee2035b75926104fce56009..628f399a35b9d201c40ece3430890ad01b513265 100644
--- a/src/future/moves/tkinter/font.py
+++ b/src/future/moves/tkinter/font.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The tkFont module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/future/moves/tkinter/messagebox.py b/src/future/moves/tkinter/messagebox.py
index 3ed52e1fecfb3b787a86236c54bbecc195a15dc3..b43d8702f59d714817786c82262357598102c6f8 100644
--- a/src/future/moves/tkinter/messagebox.py
+++ b/src/future/moves/tkinter/messagebox.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The tkMessageBox module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/future/moves/tkinter/scrolledtext.py b/src/future/moves/tkinter/scrolledtext.py
index 13bd660d96f4b72612d2c04d936dd81dc95963cc..1c69db60672ddd94467360cef644c2bfe8640066 100644
--- a/src/future/moves/tkinter/scrolledtext.py
+++ b/src/future/moves/tkinter/scrolledtext.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The ScrolledText module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/future/moves/tkinter/simpledialog.py b/src/future/moves/tkinter/simpledialog.py
index e952fa994e4e6fe97affc20171b175c6b7dbe67d..dba93fbf259e1ff64c7dcf893de872861f9a6d8b 100644
--- a/src/future/moves/tkinter/simpledialog.py
+++ b/src/future/moves/tkinter/simpledialog.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The SimpleDialog module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/future/moves/tkinter/tix.py b/src/future/moves/tkinter/tix.py
index 019df6f73f8fa3d683ca7a3b18a8a23c95f33c39..8d1718ad0b717b79380860609e9c392c1ee219de 100644
--- a/src/future/moves/tkinter/tix.py
+++ b/src/future/moves/tkinter/tix.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The Tix module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/future/moves/tkinter/ttk.py b/src/future/moves/tkinter/ttk.py
index 22ac9774c46ee350976bcae83421a69526911b1f..081c1b49562b61e529313a1b6588b7b42ceb4c94 100644
--- a/src/future/moves/tkinter/ttk.py
+++ b/src/future/moves/tkinter/ttk.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The ttk module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/future/moves/urllib/__init__.py b/src/future/moves/urllib/__init__.py
index 8d1298c9f7c0af9da2b761225391fb96a3d6ccd0..5cf428b6ec4d7142223f2c5d52d448116e6bbe71 100644
--- a/src/future/moves/urllib/__init__.py
+++ b/src/future/moves/urllib/__init__.py
@@ -3,4 +3,3 @@ from future.utils import PY3
 
 if not PY3:
     __future_module__ = True
-
diff --git a/src/future/moves/urllib/error.py b/src/future/moves/urllib/error.py
index ae49255f08404c8d293f3c4396a05798d701a43c..7d8ada73f8fd2fa4e5958f878c0f5d3c8da77bba 100644
--- a/src/future/moves/urllib/error.py
+++ b/src/future/moves/urllib/error.py
@@ -7,10 +7,10 @@ if PY3:
     from urllib.error import *
 else:
     __future_module__ = True
-    
+
     # We use this method to get at the original Py2 urllib before any renaming magic
     # ContentTooShortError = sys.py2_modules['urllib'].ContentTooShortError
-    
+
     with suspend_hooks():
         from urllib import ContentTooShortError
         from urllib2 import URLError, HTTPError
diff --git a/src/future/moves/urllib/parse.py b/src/future/moves/urllib/parse.py
index 832dfb51643186a1de3912a6ad32da3cd681e9ea..9074b8163f68d78dc4af40a8f096f01f4a10ae5c 100644
--- a/src/future/moves/urllib/parse.py
+++ b/src/future/moves/urllib/parse.py
@@ -10,7 +10,7 @@ else:
     from urlparse import (ParseResult, SplitResult, parse_qs, parse_qsl,
                           urldefrag, urljoin, urlparse, urlsplit,
                           urlunparse, urlunsplit)
-    
+
     # we use this method to get at the original py2 urllib before any renaming
     # quote = sys.py2_modules['urllib'].quote
     # quote_plus = sys.py2_modules['urllib'].quote_plus
@@ -18,7 +18,7 @@ else:
     # unquote_plus = sys.py2_modules['urllib'].unquote_plus
     # urlencode = sys.py2_modules['urllib'].urlencode
     # splitquery = sys.py2_modules['urllib'].splitquery
-    
+
     with suspend_hooks():
         from urllib import (quote,
                             quote_plus,
diff --git a/src/future/moves/urllib/request.py b/src/future/moves/urllib/request.py
index 375dc29f8577fc5b6847024b6264ada7c84ee002..60e440a77ed6545fbb93cb0274a148fefdf4f9d0 100644
--- a/src/future/moves/urllib/request.py
+++ b/src/future/moves/urllib/request.py
@@ -51,7 +51,7 @@ else:
         #                     URLopener,
         #                     FancyURLopener,
         #                     proxy_bypass)
-    
+
         # from urllib2 import (
         #                  AbstractBasicAuthHandler,
         #                  AbstractDigestAuthHandler,
@@ -80,7 +80,7 @@ else:
         #                  UnknownHandler,
         #                  urlopen,
         #                 )
-    
+
         # from urlparse import (
         #                  urldefrag
         #                  urljoin,
diff --git a/src/future/moves/urllib/response.py b/src/future/moves/urllib/response.py
index 120ea13e7e77261786946313bf3ae104ebdbd39b..a287ae2833f0ca66545f7f83dfced593f7c18406 100644
--- a/src/future/moves/urllib/response.py
+++ b/src/future/moves/urllib/response.py
@@ -10,4 +10,3 @@ else:
                             addclosehook,
                             addinfo,
                             addinfourl)
-
diff --git a/src/future/standard_library/__init__.py b/src/future/standard_library/__init__.py
index aca58c3e5c7389835b1270c05b6ea87a7c95cbd7..cff02f95943b786b05b98f9dde4a62ed23acd2d3 100644
--- a/src/future/standard_library/__init__.py
+++ b/src/future/standard_library/__init__.py
@@ -30,7 +30,7 @@ And then these normal Py3 imports work on both Py3 and Py2::
     from itertools import filterfalse, zip_longest
     from sys import intern
     from collections import UserDict, UserList, UserString
-    from collections import OrderedDict, Counter     # even on Py2.6
+    from collections import OrderedDict, Counter, ChainMap     # even on Py2.6
     from subprocess import getoutput, getstatusoutput
     from subprocess import check_output              # even on Py2.6
 
@@ -180,6 +180,7 @@ assert len(set(RENAMES.values()) & set(REPLACED_MODULES)) == 0
 MOVES = [('collections', 'UserList', 'UserList', 'UserList'),
          ('collections', 'UserDict', 'UserDict', 'UserDict'),
          ('collections', 'UserString','UserString', 'UserString'),
+         ('collections', 'ChainMap', 'future.backports.misc', 'ChainMap'),
          ('itertools', 'filterfalse','itertools', 'ifilterfalse'),
          ('itertools', 'zip_longest','itertools', 'izip_longest'),
          ('sys', 'intern','__builtin__', 'intern'),
@@ -195,6 +196,7 @@ MOVES = [('collections', 'UserList', 'UserList', 'UserList'),
          ('math', 'ceil', 'future.backports.misc', 'ceil'),
          ('collections', 'OrderedDict', 'future.backports.misc', 'OrderedDict'),
          ('collections', 'Counter', 'future.backports.misc', 'Counter'),
+         ('collections', 'ChainMap', 'future.backports.misc', 'ChainMap'),
          ('itertools', 'count', 'future.backports.misc', 'count'),
          ('reprlib', 'recursive_repr', 'future.backports.misc', 'recursive_repr'),
          ('functools', 'cmp_to_key', 'future.backports.misc', 'cmp_to_key'),
@@ -396,7 +398,7 @@ def scrub_future_sys_modules():
     """
     Deprecated.
     """
-    return {}    
+    return {}
 
 class suspend_hooks(object):
     """
diff --git a/src/future/tests/base.py b/src/future/tests/base.py
index 546c779b097253aa60754ec8144b74fd19d6d90d..9f4607b691501b83cb36bc92e9fc7d66b049b85f 100644
--- a/src/future/tests/base.py
+++ b/src/future/tests/base.py
@@ -163,7 +163,7 @@ class CodeHandler(unittest.TestCase):
         """
         Converts the code block using ``futurize`` and returns the
         resulting code.
-        
+
         Passing stages=[1] or stages=[2] passes the flag ``--stage1`` or
         ``stage2`` to ``futurize``. Passing both stages runs ``futurize``
         with both stages by default.
@@ -259,10 +259,10 @@ class CodeHandler(unittest.TestCase):
 
         If ignore_imports is True, ignores the presence of any lines
         beginning:
-        
+
             from __future__ import ...
             from future import ...
-            
+
         for the purpose of the comparison.
         """
         output = self.convert(before, stages=stages, all_imports=all_imports,
diff --git a/src/future/types/__init__.py b/src/future/types/__init__.py
index 71279bbb49267abef9afcbe09e3fe9c8e5f6cda8..062507703eb2be7631f66e97ef5d475d9f897656 100644
--- a/src/future/types/__init__.py
+++ b/src/future/types/__init__.py
@@ -15,7 +15,7 @@ It is used as follows::
 
 to bring in the new semantics for these functions from Python 3. And
 then, for example::
-    
+
     b = bytes(b'ABCD')
     assert list(b) == [65, 66, 67, 68]
     assert repr(b) == "b'ABCD'"
@@ -46,7 +46,7 @@ then, for example::
         pass
 
 and::
-    
+
     class VerboseList(list):
         def append(self, item):
             print('Adding an item')
@@ -112,7 +112,7 @@ def disallow_types(argnums, disallowed_types):
     raises a TypeError when f is called if a unicode object is passed as
     `a` or a bytes object is passed as `b`.
 
-    This also skips over keyword arguments, so 
+    This also skips over keyword arguments, so
 
         @disallow_types([0, 1], [unicode, bytes])
         def g(a, b=None):
@@ -130,7 +130,7 @@ def disallow_types(argnums, disallowed_types):
     ...     def __add__(self, other):
     ...          pass
 
-    >>> newbytes('1234') + u'1234'      #doctest: +IGNORE_EXCEPTION_DETAIL 
+    >>> newbytes('1234') + u'1234'      #doctest: +IGNORE_EXCEPTION_DETAIL
     Traceback (most recent call last):
       ...
     TypeError: can't concat 'bytes' to (unicode) str
@@ -255,4 +255,3 @@ else:
                 unicode: newstr}
 
     __all__ = ['newbytes', 'newdict', 'newint', 'newlist', 'newrange', 'newstr', 'newtypes']
-
diff --git a/src/future/types/newbytes.py b/src/future/types/newbytes.py
index 85e6501cba614a9d4c052e9b60b806b4171ee9bd..2a337c864529aacd586061c52f6855317706264d 100644
--- a/src/future/types/newbytes.py
+++ b/src/future/types/newbytes.py
@@ -100,6 +100,8 @@ class newbytes(with_metaclass(BaseNewBytes, _builtin_bytes)):
                 newargs.append(errors)
             value = args[0].encode(*newargs)
             ###
+        elif hasattr(args[0], '__bytes__'):
+            value = args[0].__bytes__()
         elif isinstance(args[0], Iterable):
             if len(args[0]) == 0:
                 # This could be an empty list or tuple. Return b'' as on Py3.
@@ -172,6 +174,29 @@ class newbytes(with_metaclass(BaseNewBytes, _builtin_bytes)):
     def __rmul__(self, other):
         return newbytes(super(newbytes, self).__rmul__(other))
 
+    def __mod__(self, vals):
+        if isinstance(vals, newbytes):
+            vals = _builtin_bytes.__str__(vals)
+
+        elif isinstance(vals, tuple):
+            newvals = []
+            for v in vals:
+                if isinstance(v, newbytes):
+                    v = _builtin_bytes.__str__(v)
+                newvals.append(v)
+            vals = tuple(newvals)
+
+        elif (hasattr(vals.__class__, '__getitem__') and
+                hasattr(vals.__class__, 'iteritems')):
+            for k, v in vals.iteritems():
+                if isinstance(v, newbytes):
+                    vals[k] = _builtin_bytes.__str__(v)
+
+        return _builtin_bytes.__mod__(self, vals)
+
+    def __imod__(self, other):
+        return self.__mod__(other)
+
     def join(self, iterable_of_bytes):
         errmsg = 'sequence item {0}: expected bytes, {1} found'
         if isbytes(iterable_of_bytes) or istext(iterable_of_bytes):
@@ -348,24 +373,24 @@ class newbytes(with_metaclass(BaseNewBytes, _builtin_bytes)):
     unorderable_err = 'unorderable types: bytes() and {0}'
 
     def __lt__(self, other):
-        if not isbytes(other):
-            raise TypeError(self.unorderable_err.format(type(other)))
-        return super(newbytes, self).__lt__(other)
+        if isinstance(other, _builtin_bytes):
+            return super(newbytes, self).__lt__(other)
+        raise TypeError(self.unorderable_err.format(type(other)))
 
     def __le__(self, other):
-        if not isbytes(other):
-            raise TypeError(self.unorderable_err.format(type(other)))
-        return super(newbytes, self).__le__(other)
+        if isinstance(other, _builtin_bytes):
+            return super(newbytes, self).__le__(other)
+        raise TypeError(self.unorderable_err.format(type(other)))
 
     def __gt__(self, other):
-        if not isbytes(other):
-            raise TypeError(self.unorderable_err.format(type(other)))
-        return super(newbytes, self).__gt__(other)
+        if isinstance(other, _builtin_bytes):
+            return super(newbytes, self).__gt__(other)
+        raise TypeError(self.unorderable_err.format(type(other)))
 
     def __ge__(self, other):
-        if not isbytes(other):
-            raise TypeError(self.unorderable_err.format(type(other)))
-        return super(newbytes, self).__ge__(other)
+        if isinstance(other, _builtin_bytes):
+            return super(newbytes, self).__ge__(other)
+        raise TypeError(self.unorderable_err.format(type(other)))
 
     def __native__(self):
         # We can't just feed a newbytes object into str(), because
diff --git a/src/future/types/newdict.py b/src/future/types/newdict.py
index 5dbcc4b7df064ad525a401791daec452672c0df3..3f3a559dd5e719f3f79d41a33959d9c0d2566dc5 100644
--- a/src/future/types/newdict.py
+++ b/src/future/types/newdict.py
@@ -100,7 +100,7 @@ class newdict(with_metaclass(BaseNewDict, _builtin_dict)):
         else:
             value = args[0]
         return super(newdict, cls).__new__(cls, value)
-        
+
     def __native__(self):
         """
         Hook for the future.utils.native() function
diff --git a/src/future/types/newobject.py b/src/future/types/newobject.py
index 1ec09ff5b4045c18f7c500ba5a05bd18e4acb69e..776d476647a12529c821d5d8aa33c2e31da413aa 100644
--- a/src/future/types/newobject.py
+++ b/src/future/types/newobject.py
@@ -15,10 +15,10 @@ Example use::
 
     a = A()
     print(str(a))
-    
+
     # On Python 2, these relations hold:
     assert unicode(a) == my_unicode_string
-    assert str(a) == my_unicode_string.encode('utf-8') 
+    assert str(a) == my_unicode_string.encode('utf-8')
 
 
 Another example::
@@ -32,29 +32,11 @@ Another example::
             return next(self._iter).upper()
         def __iter__(self):
             return self
-    
+
     assert list(Upper('hello')) == list('HELLO')
 
 """
 
-import sys
-
-from future.utils import with_metaclass
-
-
-_builtin_object = object
-ver = sys.version_info[:2]
-
-
-# We no longer define a metaclass for newobject because this breaks multiple
-# inheritance and custom metaclass use with this exception:
-
-# TypeError: Error when calling the metaclass bases
-#     metaclass conflict: the metaclass of a derived class must be a
-#     (non-strict) subclass of the metaclasses of all its bases
-
-# See issues #91 and #96.
-
 
 class newobject(object):
     """
@@ -62,7 +44,7 @@ class newobject(object):
         next
         __unicode__
         __nonzero__
-    
+
     Subclasses of this class can merely define the Python 3 methods (__next__,
     __str__, and __bool__).
     """
@@ -70,7 +52,7 @@ class newobject(object):
         if hasattr(self, '__next__'):
             return type(self).__next__(self)
         raise TypeError('newobject is not an iterator')
-    
+
     def __unicode__(self):
         # All subclasses of the builtin object should have __str__ defined.
         # Note that old-style classes do not have __str__ defined.
@@ -123,7 +105,7 @@ class newobject(object):
     #     else:
     #         value = args[0]
     #     return super(newdict, cls).__new__(cls, value)
-        
+
     def __native__(self):
         """
         Hook for the future.utils.native() function
diff --git a/src/future/types/newopen.py b/src/future/types/newopen.py
index 8da064274f6650c1ee518d65689635466ae87d30..b75d45afb245df6c2f12aa717c280339a1f95ec9 100644
--- a/src/future/types/newopen.py
+++ b/src/future/types/newopen.py
@@ -30,4 +30,3 @@ class newopen(object):
 
     def __exit__(self, etype, value, traceback):
         self.f.close()
-
diff --git a/src/future/types/newrange.py b/src/future/types/newrange.py
index c190ba9e3da07df0b60c89ce5f85603b7ada0eec..9173b05091cd26558dc46d2a0e8a569524c9d903 100644
--- a/src/future/types/newrange.py
+++ b/src/future/types/newrange.py
@@ -90,7 +90,10 @@ class newrange(Sequence):
     def index(self, value):
         """Return the 0-based position of integer `value` in
         the sequence this range represents."""
-        diff = value - self._start
+        try:
+            diff = value - self._start
+        except TypeError:
+            raise ValueError('%r is not in range' % value)
         quotient, remainder = divmod(diff, self._step)
         if remainder == 0 and 0 <= quotient < self._len:
             return abs(quotient)
@@ -152,6 +155,9 @@ class range_iterator(Iterator):
     def __iter__(self):
         return self
 
+    def __next__(self):
+        return next(self._stepper)
+
     def next(self):
         return next(self._stepper)
 
diff --git a/src/future/types/newstr.py b/src/future/types/newstr.py
index fd8615aff18cc8267302351855fea20910df4c5a..e6272fb9009b327a0f71d46bf30345eab3deb8cd 100644
--- a/src/future/types/newstr.py
+++ b/src/future/types/newstr.py
@@ -37,7 +37,7 @@ Note that ``str()`` (and ``print()``) would then normally call the
 ``__unicode__`` method on objects in Python 2. To define string
 representations of your objects portably across Py3 and Py2, use the
 :func:`python_2_unicode_compatible` decorator in  :mod:`future.utils`.
-    
+
 """
 
 from collections import Iterable
@@ -73,7 +73,7 @@ class newstr(with_metaclass(BaseNewStr, unicode)):
 
           str(object='') -> str
           str(bytes_or_buffer[, encoding[, errors]]) -> str
-          
+
           Create a new string object from the given object. If encoding or
           errors is specified, then the object must expose a data buffer
           that will be decoded using the given encoding and error handler.
@@ -81,7 +81,7 @@ class newstr(with_metaclass(BaseNewStr, unicode)):
           or repr(object).
           encoding defaults to sys.getdefaultencoding().
           errors defaults to 'strict'.
-        
+
         """
         if len(args) == 0:
             return super(newstr, cls).__new__(cls)
@@ -100,7 +100,7 @@ class newstr(with_metaclass(BaseNewStr, unicode)):
         else:
             value = args[0]
         return super(newstr, cls).__new__(cls, value)
-        
+
     def __repr__(self):
         """
         Without the u prefix
@@ -128,7 +128,7 @@ class newstr(with_metaclass(BaseNewStr, unicode)):
         else:
             raise TypeError(errmsg.format(type(key)))
         return issubset(list(newkey), list(self))
-    
+
     @no('newbytes')
     def __add__(self, other):
         return newstr(super(newstr, self).__add__(other))
@@ -302,24 +302,28 @@ class newstr(with_metaclass(BaseNewStr, unicode)):
     unorderable_err = 'unorderable types: str() and {0}'
 
     def __lt__(self, other):
-        if not istext(other):
-            raise TypeError(self.unorderable_err.format(type(other)))
-        return super(newstr, self).__lt__(other)
+        if (isinstance(other, unicode) or
+            isinstance(other, bytes) and not isnewbytes(other)):
+            return super(newstr, self).__lt__(other)
+        raise TypeError(self.unorderable_err.format(type(other)))
 
     def __le__(self, other):
-        if not istext(other):
-            raise TypeError(self.unorderable_err.format(type(other)))
-        return super(newstr, self).__le__(other)
+        if (isinstance(other, unicode) or
+            isinstance(other, bytes) and not isnewbytes(other)):
+            return super(newstr, self).__le__(other)
+        raise TypeError(self.unorderable_err.format(type(other)))
 
     def __gt__(self, other):
-        if not istext(other):
-            raise TypeError(self.unorderable_err.format(type(other)))
-        return super(newstr, self).__gt__(other)
+        if (isinstance(other, unicode) or
+            isinstance(other, bytes) and not isnewbytes(other)):
+            return super(newstr, self).__gt__(other)
+        raise TypeError(self.unorderable_err.format(type(other)))
 
     def __ge__(self, other):
-        if not istext(other):
-            raise TypeError(self.unorderable_err.format(type(other)))
-        return super(newstr, self).__ge__(other)
+        if (isinstance(other, unicode) or
+            isinstance(other, bytes) and not isnewbytes(other)):
+            return super(newstr, self).__ge__(other)
+        raise TypeError(self.unorderable_err.format(type(other)))
 
     def __getattribute__(self, name):
         """
diff --git a/src/future/utils/__init__.py b/src/future/utils/__init__.py
index cb4ade35df83fd812c8834c9a0818b442be9a4c0..906f1e464994f49ad14666561bc57d2a3e5050e7 100644
--- a/src/future/utils/__init__.py
+++ b/src/future/utils/__init__.py
@@ -18,7 +18,7 @@ This module exports useful functions for 2/3 compatible code:
     * types:
 
         * text_type: unicode in Python 2, str in Python 3
-        * binary_type: str in Python 2, bythes in Python 3
+        * binary_type: str in Python 2, bytes in Python 3
         * string_types: basestring in Python 2, str in Python 3
 
     * bchr(c):
@@ -56,6 +56,8 @@ import inspect
 
 
 PY3 = sys.version_info[0] == 3
+PY35_PLUS = sys.version_info[0:2] >= (3, 5)
+PY36_PLUS = sys.version_info[0:2] >= (3, 6)
 PY2 = sys.version_info[0] == 2
 PY26 = sys.version_info[0:2] == (2, 6)
 PY27 = sys.version_info[0:2] == (2, 7)
diff --git a/src/future/utils/surrogateescape.py b/src/future/utils/surrogateescape.py
index 398c3531b63040335f86b316435aefcd3c1464ec..0dcc9fa6e6067deb7fb98b41a77011c1570e3741 100644
--- a/src/future/utils/surrogateescape.py
+++ b/src/future/utils/surrogateescape.py
@@ -83,7 +83,7 @@ def replace_surrogate_encode(mystring):
         # The following magic comes from Py3.3's Python/codecs.c file:
         if not 0xD800 <= code <= 0xDCFF:
             # Not a surrogate. Fail with the original exception.
-            raise exc
+            raise NotASurrogateError
         # mybytes = [0xe0 | (code >> 12),
         #            0x80 | ((code >> 6) & 0x3f),
         #            0x80 | (code & 0x3f)]
@@ -196,5 +196,3 @@ if __name__ == '__main__':
     # c = encodefilename(b)
     # assert c == fn, '%r != %r' % (c, fn)
     # # print("ok")
-
-
diff --git a/src/libfuturize/fixer_util.py b/src/libfuturize/fixer_util.py
index ce1e9753b6cf0fc7005c67032d9c56a088c2012c..48e4689db96917b39586f1f939142741dd46203d 100644
--- a/src/libfuturize/fixer_util.py
+++ b/src/libfuturize/fixer_util.py
@@ -62,7 +62,7 @@ def Minus(prefix=None):
 
 def commatize(leafs):
     """
-    Accepts/turns: (Name, Name, ..., Name, Name) 
+    Accepts/turns: (Name, Name, ..., Name, Name)
     Returns/into: (Name, Comma, Name, Comma, ..., Name, Comma, Name)
     """
     new_leafs = []
@@ -272,7 +272,7 @@ def future_import2(feature, node):
     An alternative to future_import() which might not work ...
     """
     root = find_root(node)
-    
+
     if does_tree_import(u"__future__", feature, node):
         return
 
@@ -304,7 +304,7 @@ def parse_args(arglist, scheme):
     Parse a list of arguments into a dict
     """
     arglist = [i for i in arglist if i.type != token.COMMA]
-    
+
     ret_mapping = dict([(k, None) for k in scheme])
 
     for i, arg in enumerate(arglist):
@@ -338,7 +338,7 @@ def touch_import_top(package, name_to_import, node):
     Based on lib2to3.fixer_util.touch_import()
 
     Calling this multiple times adds the imports in reverse order.
-        
+
     Also adds "standard_library.install_aliases()" after "from future import
     standard_library".  This should probably be factored into another function.
     """
@@ -415,7 +415,7 @@ def touch_import_top(package, name_to_import, node):
             children_hooks = [install_hooks, Newline()]
         else:
             children_hooks = []
-        
+
         # FromImport(package, [Leaf(token.NAME, name_to_import, prefix=u" ")])
 
     children_import = [import_, Newline()]
@@ -443,7 +443,10 @@ def check_future_import(node):
             hasattr(node.children[1], 'value') and
             node.children[1].value == u'__future__'):
         return set()
-    node = node.children[3]
+    if node.children[3].type == token.LPAR:
+        node = node.children[4]
+    else:
+        node = node.children[3]
     # now node is the import_as_name[s]
     # print(python_grammar.number2symbol[node.type])  # breaks sometimes
     if node.type == syms.import_as_names:
@@ -504,15 +507,14 @@ def wrap_in_fn_call(fn_name, args, prefix=None):
 
     >>> wrap_in_fn_call("olddiv", (arg1, arg2))
     olddiv(arg1, arg2)
+
+    >>> wrap_in_fn_call("olddiv", [arg1, comma, arg2, comma, arg3])
+    olddiv(arg1, arg2, arg3)
     """
     assert len(args) > 0
-    if len(args) == 1:
-        newargs = args
-    elif len(args) == 2:
+    if len(args) == 2:
         expr1, expr2 = args
         newargs = [expr1, Comma(), expr2]
     else:
-        assert NotImplementedError('write me')
+        newargs = args
     return Call(Name(fn_name), newargs, prefix=prefix)
-
-
diff --git a/src/libfuturize/fixes/__init__.py b/src/libfuturize/fixes/__init__.py
index a059c949dd1a4136ca1e4c97b29cd83a6e57d01f..7de304da7fe688d8b8b74cf69ad7d58e9d95cc5d 100644
--- a/src/libfuturize/fixes/__init__.py
+++ b/src/libfuturize/fixes/__init__.py
@@ -94,4 +94,3 @@ libfuturize_fix_names_stage2 = set([
     # 'libfuturize.fixes.fix_unicode_literals_import',
     'libfuturize.fixes.fix_xrange_with_import',  # custom one because of a bug with Py3.3's lib2to3
 ])
-
diff --git a/src/libfuturize/fixes/fix_UserDict.py b/src/libfuturize/fixes/fix_UserDict.py
index 73b1cfb88e086a2b383b323ac2eff76cd51fb7c5..cb0cfacc6a70b6ea201227d450565d1613427e09 100644
--- a/src/libfuturize/fixes/fix_UserDict.py
+++ b/src/libfuturize/fixes/fix_UserDict.py
@@ -16,12 +16,12 @@ MAPPING = {'UserDict':  'collections',
 
 # def alternates(members):
 #     return "(" + "|".join(map(repr, members)) + ")"
-# 
-# 
+#
+#
 # def build_pattern(mapping=MAPPING):
 #     mod_list = ' | '.join(["module_name='%s'" % key for key in mapping])
 #     bare_names = alternates(mapping.keys())
-# 
+#
 #     yield """name_import=import_name< 'import' ((%s) |
 #                multiple_imports=dotted_as_names< any* (%s) any* >) >
 #           """ % (mod_list, mod_list)
@@ -33,7 +33,7 @@ MAPPING = {'UserDict':  'collections',
 #                multiple_imports=dotted_as_names<
 #                  any* dotted_as_name< (%s) 'as' any > any* >) >
 #           """ % (mod_list, mod_list)
-# 
+#
 #     # Find usages of module members in code e.g. thread.foo(bar)
 #     yield "power< bare_with_attr=(%s) trailer<'.' any > any* >" % bare_names
 
@@ -100,4 +100,3 @@ class FixUserdict(FixImports):
             new_name = self.replace.get(bare_name.value)
             if new_name:
                 bare_name.replace(Name(new_name, prefix=bare_name.prefix))
-
diff --git a/src/libfuturize/fixes/fix_absolute_import.py b/src/libfuturize/fixes/fix_absolute_import.py
index ab6a7647cb90982722d9042585892cf46e9379ab..eab9c527d34cd0019a8ec0f18f3ac2cd1bbb2fb7 100644
--- a/src/libfuturize/fixes/fix_absolute_import.py
+++ b/src/libfuturize/fixes/fix_absolute_import.py
@@ -89,4 +89,3 @@ class FixAbsoluteImport(FixImport):
             if exists(base_path + ext):
                 return True
         return False
-
diff --git a/src/libfuturize/fixes/fix_add__future__imports_except_unicode_literals.py b/src/libfuturize/fixes/fix_add__future__imports_except_unicode_literals.py
index 1904d37b4d440998614ca5702bbc2cfc52c59be6..1d419a1c66e778fdf6d56561fb7195fb446c3ed9 100644
--- a/src/libfuturize/fixes/fix_add__future__imports_except_unicode_literals.py
+++ b/src/libfuturize/fixes/fix_add__future__imports_except_unicode_literals.py
@@ -24,4 +24,3 @@ class FixAddFutureImportsExceptUnicodeLiterals(fixer_base.BaseFix):
         future_import(u"print_function", node)
         future_import(u"division", node)
         future_import(u"absolute_import", node)
-
diff --git a/src/libfuturize/fixes/fix_basestring.py b/src/libfuturize/fixes/fix_basestring.py
index 8c6ec6ced317b284db666408a5bf881ad094aa03..5676d08fcd5198103102e7b41f1b3d9a43e6fc85 100644
--- a/src/libfuturize/fixes/fix_basestring.py
+++ b/src/libfuturize/fixes/fix_basestring.py
@@ -15,4 +15,3 @@ class FixBasestring(fixer_base.BaseFix):
 
     def transform(self, node, results):
         touch_import_top(u'past.builtins', 'basestring', node)
-
diff --git a/src/libfuturize/fixes/fix_cmp.py b/src/libfuturize/fixes/fix_cmp.py
index be56507eb5a7eee73db0f7d0ff381130c267a725..762eb4b42e11e6c10ce7b612638e1a55fbb958fe 100644
--- a/src/libfuturize/fixes/fix_cmp.py
+++ b/src/libfuturize/fixes/fix_cmp.py
@@ -31,4 +31,3 @@ class FixCmp(fixer_base.BaseFix):
     def transform(self, node, results):
         name = results["name"]
         touch_import_top(u'past.builtins', name.value, node)
-
diff --git a/src/libfuturize/fixes/fix_division.py b/src/libfuturize/fixes/fix_division.py
index 48745504429528c81f201d4f2b7f4a7e5bdc0f66..6975a52bb941522056890757143bcfb74a0bb546 100644
--- a/src/libfuturize/fixes/fix_division.py
+++ b/src/libfuturize/fixes/fix_division.py
@@ -10,4 +10,3 @@ at the top so the code runs identically on Py3 and Py2.6/2.7
 """
 
 from libpasteurize.fixes.fix_division import FixDivision
-
diff --git a/src/libfuturize/fixes/fix_division_safe.py b/src/libfuturize/fixes/fix_division_safe.py
index 5e16b0a514cea96abc2b51736ca7b60b44bc4382..7b0f3cbd7a235d828e6d802ba03cdf09cc8d6b1c 100644
--- a/src/libfuturize/fixes/fix_division_safe.py
+++ b/src/libfuturize/fixes/fix_division_safe.py
@@ -13,6 +13,9 @@ If "from __future__ import division" is already in effect, this fixer does
 nothing.
 """
 
+import re
+import lib2to3.pytree as pytree
+from lib2to3.fixer_util import Leaf, Node, Comma
 from lib2to3 import fixer_base
 from lib2to3.fixer_util import syms, does_tree_import
 from libfuturize.fixer_util import (token, future_import, touch_import_top,
@@ -28,6 +31,43 @@ def match_division(node):
     return node.type == slash and not node.next_sibling.type == slash and \
                                   not node.prev_sibling.type == slash
 
+const_re = re.compile('^[0-9]*[.][0-9]*$')
+
+def is_floaty(node, div_idx):
+    return _is_floaty(node.children[0:div_idx]) or _is_floaty(node.children[div_idx+1:])
+
+
+def _is_floaty(expr):
+    if isinstance(expr, list):
+        expr = expr[0]
+
+    if isinstance(expr, Leaf):
+        # If it's a leaf, let's see if it's a numeric constant containing a '.'
+        return const_re.match(expr.value)
+    elif isinstance(expr, Node):
+        # If the expression is a node, let's see if it's a direct cast to float
+        if isinstance(expr.children[0], Leaf):
+            return expr.children[0].value == u'float'
+    return False
+
+def find_division(node):
+    for i, child in enumerate(node.children):
+        if match_division(child):
+            return i
+    return False
+
+def clone_div_operands(node, div_idx):
+    children = []
+    for i, child in enumerate(node.children):
+        if i == div_idx:
+            children.append(Comma())
+        else:
+            children.append(child.clone())
+
+    # Strip any leading space for the first number:
+    children[0].prefix = u''
+
+    return children
 
 class FixDivisionSafe(fixer_base.BaseFix):
     # BM_compatible = True
@@ -51,22 +91,19 @@ class FixDivisionSafe(fixer_base.BaseFix):
         Since the tree needs to be fixed once and only once if and only if it
         matches, we can start discarding matches after the first.
         """
-        if (node.type == self.syms.term and 
-                    len(node.children) == 3 and
-                    match_division(node.children[1])):
-            expr1, expr2 = node.children[0], node.children[2]
-            return expr1, expr2
-        else:
-            return False
+        if node.type == self.syms.term:
+            div_idx = find_division(node)
+            if div_idx is not False:
+                # if expr1 or expr2 are obviously floats, we don't need to wrap in
+                # old_div, as the behavior of division between any number and a float
+                # should be the same in 2 or 3
+                if not is_floaty(node, div_idx):
+                    return clone_div_operands(node, div_idx)
+        return False
 
     def transform(self, node, results):
         if self.skip:
             return
         future_import(u"division", node)
-
         touch_import_top(u'past.utils', u'old_div', node)
-        expr1, expr2 = results[0].clone(), results[1].clone()
-        # Strip any leading space for the first number:
-        expr1.prefix = u''
-        return wrap_in_fn_call("old_div", (expr1, expr2), prefix=node.prefix)
-
+        return wrap_in_fn_call("old_div", results, prefix=node.prefix)
diff --git a/src/libfuturize/fixes/fix_execfile.py b/src/libfuturize/fixes/fix_execfile.py
index 2b794c882f9fba8d41cc57ff2d0412fef2e87e8a..cfe9d8d0f6dfaa720a67d3dfa78c2ff9da5d0ed4 100644
--- a/src/libfuturize/fixes/fix_execfile.py
+++ b/src/libfuturize/fixes/fix_execfile.py
@@ -35,4 +35,3 @@ class FixExecfile(fixer_base.BaseFix):
     def transform(self, node, results):
         name = results["name"]
         touch_import_top(u'past.builtins', name.value, node)
-
diff --git a/src/libfuturize/fixes/fix_future_builtins.py b/src/libfuturize/fixes/fix_future_builtins.py
index bf3aba40e1e975733db34148ace339c1379f7bf3..eea6c6a1ee9f23465705e1459616a1bfc1f1aa83 100644
--- a/src/libfuturize/fixes/fix_future_builtins.py
+++ b/src/libfuturize/fixes/fix_future_builtins.py
@@ -57,4 +57,3 @@ class FixFutureBuiltins(fixer_base.BaseFix):
         name = results["name"]
         touch_import_top(u'builtins', name.value, node)
         # name.replace(Name(u"input", prefix=name.prefix))
-
diff --git a/src/libfuturize/fixes/fix_future_standard_library.py b/src/libfuturize/fixes/fix_future_standard_library.py
index 501c2a940e814bfc57e9d09cfd073399d3c725fa..a1c3f3d4ea0bdb2ef74431a9be6fffe7a55bd552 100644
--- a/src/libfuturize/fixes/fix_future_standard_library.py
+++ b/src/libfuturize/fixes/fix_future_standard_library.py
@@ -22,5 +22,3 @@ class FixFutureStandardLibrary(FixImports):
         # TODO: add a blank line between any __future__ imports and this?
         touch_import_top(u'future', u'standard_library', node)
         return result
-
-
diff --git a/src/libfuturize/fixes/fix_future_standard_library_urllib.py b/src/libfuturize/fixes/fix_future_standard_library_urllib.py
index 3d62959fd29e99046d899b6a11396411f6772da5..cf6738845f40cd9fd50e6ef0567e57946bc7a5c6 100644
--- a/src/libfuturize/fixes/fix_future_standard_library_urllib.py
+++ b/src/libfuturize/fixes/fix_future_standard_library_urllib.py
@@ -26,5 +26,3 @@ class FixFutureStandardLibraryUrllib(FixUrllib):     # not a subclass of FixImpo
         # TODO: add a blank line between any __future__ imports and this?
         touch_import_top(u'future', u'standard_library', root)
         return result
-
-
diff --git a/src/libfuturize/fixes/fix_order___future__imports.py b/src/libfuturize/fixes/fix_order___future__imports.py
index 143126394d2eab16299113142fdf3bd2a8e64890..00d7ef60612d5cd64a036980459213dac0a6da9e 100644
--- a/src/libfuturize/fixes/fix_order___future__imports.py
+++ b/src/libfuturize/fixes/fix_order___future__imports.py
@@ -34,4 +34,3 @@ class FixOrderFutureImports(fixer_base.BaseFix):
     def transform(self, node, results):
         # TODO    # write me
         pass
-
diff --git a/src/libfuturize/fixes/fix_print_with_import.py b/src/libfuturize/fixes/fix_print_with_import.py
index 5308d9252a8e1f4990a12036a870afbee30d3ef1..3449046101e8144d0ac47df87c4e1ca489f98195 100644
--- a/src/libfuturize/fixes/fix_print_with_import.py
+++ b/src/libfuturize/fixes/fix_print_with_import.py
@@ -20,4 +20,3 @@ class FixPrintWithImport(FixPrint):
         future_import(u'print_function', node)
         n_stmt = super(FixPrintWithImport, self).transform(node, results)
         return n_stmt
-
diff --git a/src/libfuturize/fixes/fix_remove_old__future__imports.py b/src/libfuturize/fixes/fix_remove_old__future__imports.py
index 060eb004176d4a0d856f76a7cb4bc78b3c8164a9..9336f75f356843955ef01e6d2d9e80d433474664 100644
--- a/src/libfuturize/fixes/fix_remove_old__future__imports.py
+++ b/src/libfuturize/fixes/fix_remove_old__future__imports.py
@@ -24,4 +24,3 @@ class FixRemoveOldFutureImports(fixer_base.BaseFix):
         remove_future_import(u"with_statement", node)
         remove_future_import(u"nested_scopes", node)
         remove_future_import(u"generators", node)
-
diff --git a/src/libfuturize/fixes/fix_unicode_keep_u.py b/src/libfuturize/fixes/fix_unicode_keep_u.py
index a6f70f092abf4a641a4b3e0717dd5e731c71e296..2e9a4e476abf46e83226a06db6b44afe21854d64 100644
--- a/src/libfuturize/fixes/fix_unicode_keep_u.py
+++ b/src/libfuturize/fixes/fix_unicode_keep_u.py
@@ -22,4 +22,3 @@ class FixUnicodeKeepU(fixer_base.BaseFix):
             new = node.clone()
             new.value = _mapping[node.value]
             return new
-
diff --git a/src/libfuturize/fixes/fix_unicode_literals_import.py b/src/libfuturize/fixes/fix_unicode_literals_import.py
index 9f21d7c69feaad8ef2ebc77b46db5a3d34add41a..51c50620b7d38489f34405c2c8b37a6afea748c7 100644
--- a/src/libfuturize/fixes/fix_unicode_literals_import.py
+++ b/src/libfuturize/fixes/fix_unicode_literals_import.py
@@ -1,6 +1,6 @@
 """
 Adds this import:
-    
+
     from __future__ import unicode_literals
 
 """
@@ -16,4 +16,3 @@ class FixUnicodeLiteralsImport(fixer_base.BaseFix):
 
     def transform(self, node, results):
         future_import(u"unicode_literals", node)
-
diff --git a/src/libfuturize/main.py b/src/libfuturize/main.py
index 18f33ec0a4545031185f26a666c39d9c5a1a4b39..634c2f25e68b5d94f5b7f5110931709697fa4a21 100644
--- a/src/libfuturize/main.py
+++ b/src/libfuturize/main.py
@@ -70,7 +70,7 @@ import logging
 import optparse
 import os
 
-from lib2to3.main import main, warn, StdoutRefactoringTool
+from lib2to3.main import warn, StdoutRefactoringTool
 from lib2to3 import refactor
 
 from libfuturize.fixes import (lib2to3_fix_names_stage1,
@@ -91,7 +91,7 @@ def main(args=None):
 
     Returns a suggested exit status (0, 1, 2).
     """
-    
+
     # Set up option parser
     parser = optparse.OptionParser(usage="futurize [options] file|dir ...")
     parser.add_option("-V", "--version", action="store_true",
@@ -205,7 +205,27 @@ def main(args=None):
         print("Use --help to show usage.", file=sys.stderr)
         return 2
 
-    unwanted_fixes = set(fixer_pkg + ".fix_" + fix for fix in options.nofix)
+    unwanted_fixes = set()
+    for fix in options.nofix:
+        if ".fix_" in fix:
+            unwanted_fixes.add(fix)
+        else:
+            # Infer the full module name for the fixer.
+            # First ensure that no names clash (e.g.
+            # lib2to3.fixes.fix_blah and libfuturize.fixes.fix_blah):
+            found = [f for f in avail_fixes
+                     if f.endswith('fix_{0}'.format(fix))]
+            if len(found) > 1:
+                print("Ambiguous fixer name. Choose a fully qualified "
+                      "module name instead from these:\n" +
+                      "\n".join("  " + myf for myf in found),
+                      file=sys.stderr)
+                return 2
+            elif len(found) == 0:
+                print("Unknown fixer. Use --list-fixes or -l for a list.",
+                      file=sys.stderr)
+                return 2
+            unwanted_fixes.add(found[0])
 
     extra_fixes = set()
     if options.all_imports:
diff --git a/src/libpasteurize/fixes/__init__.py b/src/libpasteurize/fixes/__init__.py
index c362ada23da1551340b217cb0e457fd7c68faf1c..905aec47e7f589b69fb750a661e1b1c9015fa1be 100644
--- a/src/libpasteurize/fixes/__init__.py
+++ b/src/libpasteurize/fixes/__init__.py
@@ -52,4 +52,3 @@ fix_names = set([
                  'libpasteurize.fixes.fix_unpacking',  # yes, this is useful
                  # 'libpasteurize.fixes.fix_with'      # way out of date
                 ])
-
diff --git a/src/libpasteurize/fixes/feature_base.py b/src/libpasteurize/fixes/feature_base.py
index 8a264964c92bf356512bcb8c704f469b86e0bad8..c36d9a951b6a8239fa8b0ea9fae0942e5937d2c4 100644
--- a/src/libpasteurize/fixes/feature_base.py
+++ b/src/libpasteurize/fixes/feature_base.py
@@ -40,7 +40,7 @@ class Features(set):
         Called every time we care about the mapping of names to features.
         """
         self.mapping = dict([(f.name, f) for f in iter(self)])
-    
+
     @property
     def PATTERN(self):
         u"""
diff --git a/src/libpasteurize/fixes/fix_add_all__future__imports.py b/src/libpasteurize/fixes/fix_add_all__future__imports.py
index 32f89ec18f775a65c0903d99134a662db79a1f9f..378979461f8c3e46765233de2322efb2e09275fa 100644
--- a/src/libpasteurize/fixes/fix_add_all__future__imports.py
+++ b/src/libpasteurize/fixes/fix_add_all__future__imports.py
@@ -22,4 +22,3 @@ class FixAddAllFutureImports(fixer_base.BaseFix):
         future_import(u"print_function", node)
         future_import(u"division", node)
         future_import(u"absolute_import", node)
-
diff --git a/src/libpasteurize/fixes/fix_add_all_future_builtins.py b/src/libpasteurize/fixes/fix_add_all_future_builtins.py
index 97204b584b3511d313b1cdc3918e82604c1746ad..22911badae63c5ef1100c40d3236cb5256dbc6bf 100644
--- a/src/libpasteurize/fixes/fix_add_all_future_builtins.py
+++ b/src/libpasteurize/fixes/fix_add_all_future_builtins.py
@@ -35,4 +35,3 @@ class FixAddAllFutureBuiltins(fixer_base.BaseFix):
         #                      range round str super zip"""
         # for builtin in sorted(builtins.split(), reverse=True):
         #     touch_import_top(u'builtins', builtin, node)
-
diff --git a/src/libpasteurize/fixes/fix_annotations.py b/src/libpasteurize/fixes/fix_annotations.py
index 1926288c2310f8a02bd4047df4db3e0e74a839e2..884b674111569b8a5270aa0aedc5e0ed5614e3a5 100644
--- a/src/libpasteurize/fixes/fix_annotations.py
+++ b/src/libpasteurize/fixes/fix_annotations.py
@@ -19,7 +19,7 @@ class FixAnnotations(fixer_base.BaseFix):
         if not self.warned:
             self.warned = True
             self.warning(node, reason=reason)
-    
+
     PATTERN = u"""
               funcdef< 'def' any parameters< '(' [params=any] ')' > ['->' ret=any] ':' any* >
               """
diff --git a/src/libpasteurize/fixes/fix_features.py b/src/libpasteurize/fixes/fix_features.py
index 7e5f545affca1bb50e252706a29c756dfb7409a4..52630f98269e1205b13c0cdda1a829a6235be236 100644
--- a/src/libpasteurize/fixes/fix_features.py
+++ b/src/libpasteurize/fixes/fix_features.py
@@ -71,7 +71,7 @@ class FixFeatures(fixer_base.BaseFix):
             # if it's there, so we don't care if it fails for normal reasons.
             pass
         return to_ret
-    
+
     def transform(self, node, results):
         for feature_name in results:
             if feature_name in self.features_warned:
diff --git a/src/libpasteurize/fixes/fix_fullargspec.py b/src/libpasteurize/fixes/fix_fullargspec.py
index 489295f7b8e4222338dabceb16dfc824540746e0..4bd37e151238370fe72a2dc0b0ebcdeb94b7c98b 100644
--- a/src/libpasteurize/fixes/fix_fullargspec.py
+++ b/src/libpasteurize/fixes/fix_fullargspec.py
@@ -8,7 +8,7 @@ from lib2to3.fixer_util import Name
 warn_msg = u"some of the values returned by getfullargspec are not valid in Python 2 and have no equivalent."
 
 class FixFullargspec(fixer_base.BaseFix):
-    
+
     PATTERN = u"'getfullargspec'"
 
     def transform(self, node, results):
diff --git a/src/libpasteurize/fixes/fix_future_builtins.py b/src/libpasteurize/fixes/fix_future_builtins.py
index 27339abc3bf6e878f0f6c6964aa49ed2e8c20076..6849679987d926b1a6d1d65bdbff5e8974e35a94 100644
--- a/src/libpasteurize/fixes/fix_future_builtins.py
+++ b/src/libpasteurize/fixes/fix_future_builtins.py
@@ -44,4 +44,3 @@ class FixFutureBuiltins(fixer_base.BaseFix):
         name = results["name"]
         touch_import_top(u'builtins', name.value, node)
         # name.replace(Name(u"input", prefix=name.prefix))
-
diff --git a/src/libpasteurize/fixes/fix_imports.py b/src/libpasteurize/fixes/fix_imports.py
index 4db0d548f52e19ff11093d66ff8f9430090a8965..2d6718f166b7a9ed6078e0f02d4769e15c3a5f29 100644
--- a/src/libpasteurize/fixes/fix_imports.py
+++ b/src/libpasteurize/fixes/fix_imports.py
@@ -110,4 +110,3 @@ class FixImports(fixer_base.BaseFix):
 
     def transform(self, node, results):
         touch_import_top(u'future', u'standard_library', node)
-
diff --git a/src/libpasteurize/fixes/fix_imports2.py b/src/libpasteurize/fixes/fix_imports2.py
index 5b30b5f5db29006455eba80c9a3639954cff0d3a..70444e9e06b590bcd170fcb6d60b94ddd6764e1f 100644
--- a/src/libpasteurize/fixes/fix_imports2.py
+++ b/src/libpasteurize/fixes/fix_imports2.py
@@ -18,11 +18,11 @@ TK_BASE_NAMES = (u'ACTIVE', u'ALL', u'ANCHOR', u'ARC',u'BASELINE', u'BEVEL', u'B
                  u'RADIOBUTTON', u'RAISED', u'READABLE', u'RIDGE', u'RIGHT',
                  u'ROUND', u'S', u'SCROLL', u'SE', u'SEL', u'SEL_FIRST', u'SEL_LAST',
                  u'SEPARATOR', u'SINGLE', u'SOLID', u'SUNKEN', u'SW', u'StringTypes',
-                 u'TOP', u'TRUE', u'TclVersion', u'TkVersion', u'UNDERLINE', 
+                 u'TOP', u'TRUE', u'TclVersion', u'TkVersion', u'UNDERLINE',
                  u'UNITS', u'VERTICAL', u'W', u'WORD', u'WRITABLE', u'X', u'Y', u'YES',
                  u'wantobjects')
 
-PY2MODULES = { 
+PY2MODULES = {
               u'urllib2' : (
                   u'AbstractBasicAuthHandler', u'AbstractDigestAuthHandler',
                   u'AbstractHTTPHandler', u'BaseHandler', u'CacheFTPHandler',
@@ -172,4 +172,3 @@ class FixImports2(fixer_base.BaseFix):
 
     def transform(self, node, results):
         touch_import_top(u'future', u'standard_library', node)
-
diff --git a/src/libpasteurize/fixes/fix_kwargs.py b/src/libpasteurize/fixes/fix_kwargs.py
index 59a3043befec1eba9553139cf58d4d0446542535..290f991eef498bfedb70f36f6a5e00ae01265b97 100644
--- a/src/libpasteurize/fixes/fix_kwargs.py
+++ b/src/libpasteurize/fixes/fix_kwargs.py
@@ -61,7 +61,7 @@ def remove_params(raw_params, kwargs_default=_kwargs_default_name):
             return False
     else:
         return True
-    
+
 def needs_fixing(raw_params, kwargs_default=_kwargs_default_name):
     u"""
     Returns string with the name of the kwargs dict if the params after the first star need fixing
@@ -145,4 +145,3 @@ class FixKwargs(fixer_base.BaseFix):
                 arglist.append_child(Comma())
             arglist.append_child(DoubleStar(prefix=u" "))
             arglist.append_child(Name(new_kwargs))
-            
diff --git a/src/libpasteurize/fixes/fix_metaclass.py b/src/libpasteurize/fixes/fix_metaclass.py
index 5e6e64d81298f8ecb8ca71067be8b403bf254c20..52dd1d1454e40131702908a9e6394114b52a7b0e 100644
--- a/src/libpasteurize/fixes/fix_metaclass.py
+++ b/src/libpasteurize/fixes/fix_metaclass.py
@@ -61,7 +61,7 @@ class FixMetaclass(fixer_base.BaseFix):
         name = meta
         name.prefix = u" "
         stmt_node = Node(syms.atom, [target, equal, name])
-        
+
         suitify(node)
         for item in node.children:
             if item.type == syms.suite:
diff --git a/src/libpasteurize/fixes/fix_unpacking.py b/src/libpasteurize/fixes/fix_unpacking.py
index 1e53a9bf77eb7a0a954f98477b43215d51f13432..c2d3207a20064153ccb8867513927188044eb400 100644
--- a/src/libpasteurize/fixes/fix_unpacking.py
+++ b/src/libpasteurize/fixes/fix_unpacking.py
@@ -60,7 +60,7 @@ class FixUnpacking(fixer_base.BaseFix):
         setup_line = Assign(Name(self.LISTNAME), Call(Name(u"list"), [source.clone()]))
         power_line = Assign(target, assignment_source(len(pre), len(post), self.LISTNAME, self.ITERNAME))
         return setup_line, power_line
-        
+
     def fix_implicit_context(self, node, results):
         u"""
         Only example of the implicit context is
diff --git a/src/libpasteurize/main.py b/src/libpasteurize/main.py
index cc0e6ec352aa3c3a734bffc3316cbc334a6291d5..4179174b566596a19163931419219215c9bd4781 100644
--- a/src/libpasteurize/main.py
+++ b/src/libpasteurize/main.py
@@ -114,8 +114,27 @@ def main(args=None):
     level = logging.DEBUG if options.verbose else logging.INFO
     logging.basicConfig(format='%(name)s: %(message)s', level=level)
 
-    # Initialize the refactoring tool
-    unwanted_fixes = set(fixer_pkg + ".fix_" + fix for fix in options.nofix)
+    unwanted_fixes = set()
+    for fix in options.nofix:
+        if ".fix_" in fix:
+            unwanted_fixes.add(fix)
+        else:
+            # Infer the full module name for the fixer.
+            # First ensure that no names clash (e.g.
+            # lib2to3.fixes.fix_blah and libfuturize.fixes.fix_blah):
+            found = [f for f in avail_fixes
+                     if f.endswith('fix_{0}'.format(fix))]
+            if len(found) > 1:
+                print("Ambiguous fixer name. Choose a fully qualified "
+                      "module name instead from these:\n" +
+                      "\n".join("  " + myf for myf in found),
+                      file=sys.stderr)
+                return 2
+            elif len(found) == 0:
+                print("Unknown fixer. Use --list-fixes or -l for a list.",
+                      file=sys.stderr)
+                return 2
+            unwanted_fixes.add(found[0])
 
     extra_fixes = set()
     if options.all_imports:
@@ -124,8 +143,45 @@ def main(args=None):
         extra_fixes.add(prefix + 'fix_add_future_standard_library_import')
         extra_fixes.add(prefix + 'fix_add_all_future_builtins')
 
-    fixer_names = avail_fixes | extra_fixes - unwanted_fixes
+    explicit = set()
+    if options.fix:
+        all_present = False
+        for fix in options.fix:
+            if fix == 'all':
+                all_present = True
+            else:
+                if ".fix_" in fix:
+                    explicit.add(fix)
+                else:
+                    # Infer the full module name for the fixer.
+                    # First ensure that no names clash (e.g.
+                    # lib2to3.fixes.fix_blah and libpasteurize.fixes.fix_blah):
+                    found = [f for f in avail_fixes
+                             if f.endswith('fix_{0}'.format(fix))]
+                    if len(found) > 1:
+                        print("Ambiguous fixer name. Choose a fully qualified "
+                              "module name instead from these:\n" +
+                              "\n".join("  " + myf for myf in found),
+                              file=sys.stderr)
+                        return 2
+                    elif len(found) == 0:
+                        print("Unknown fixer. Use --list-fixes or -l for a list.",
+                              file=sys.stderr)
+                        return 2
+                    explicit.add(found[0])
+        if len(explicit & unwanted_fixes) > 0:
+            print("Conflicting usage: the following fixers have been "
+                  "simultaneously requested and disallowed:\n" +
+                  "\n".join("  " + myf for myf in (explicit & unwanted_fixes)),
+                  file=sys.stderr)
+            return 2
+        requested = avail_fixes.union(explicit) if all_present else explicit
+    else:
+        requested = avail_fixes.union(explicit)
+
+    fixer_names = requested | extra_fixes - unwanted_fixes
 
+    # Initialize the refactoring tool
     rt = StdoutRefactoringTool(sorted(fixer_names), flags, set(),
                                options.nobackups, not options.no_diffs)
 
@@ -146,4 +202,3 @@ def main(args=None):
 
     # Return error status (0 if rt.errors is zero)
     return int(bool(rt.errors))
-
diff --git a/src/past/__init__.py b/src/past/__init__.py
index 08eeb58d6d8483f3fbf732bd1bf12ebb0e14dddb..3b5d9db178995d01731e784340b7de496ad89a63 100644
--- a/src/past/__init__.py
+++ b/src/past/__init__.py
@@ -67,7 +67,7 @@ this::
 
 until the authors of the Python 2 modules have upgraded their code. Then, for
 example::
-    
+
     >>> mypy2module.func_taking_py2_string(oldstr(b'abcd'))
 
 
@@ -80,7 +80,7 @@ Credits
 
 Licensing
 ---------
-Copyright 2013-2016 Python Charmers Pty Ltd, Australia.
+Copyright 2013-2018 Python Charmers Pty Ltd, Australia.
 The software is distributed under an MIT licence. See LICENSE.txt.
 """
 
@@ -90,4 +90,3 @@ from future import __version__, __copyright__, __license__
 
 __title__ = 'past'
 __author__ = 'Ed Schofield'
-
diff --git a/src/past/builtins/__init__.py b/src/past/builtins/__init__.py
index a967736d036993268bc8327659dac15fe3960237..1b19e373c87be6d5956e98eeae1dbaa40f5cd2e8 100644
--- a/src/past/builtins/__init__.py
+++ b/src/past/builtins/__init__.py
@@ -59,9 +59,9 @@ from past import utils
 if utils.PY3:
     # We only import names that shadow the builtins on Py3. No other namespace
     # pollution on Py3.
-    
+
     # Only shadow builtins on Py3; no new names
-    __all__ = ['filter', 'map', 'range', 'reduce', 'zip', 
+    __all__ = ['filter', 'map', 'range', 'reduce', 'zip',
                'basestring', 'dict', 'str', 'long', 'unicode',
                'apply', 'chr', 'cmp', 'execfile', 'intern', 'raw_input',
                'reload', 'unichr', 'xrange'
diff --git a/src/past/builtins/misc.py b/src/past/builtins/misc.py
index 55dc63c629fdf8b366ce4e1e36904cd7b5d47c27..06fbb92d200b5647b8397ae04717d9acc58d0c00 100644
--- a/src/past/builtins/misc.py
+++ b/src/past/builtins/misc.py
@@ -87,4 +87,3 @@ if PY3:
                'reload', 'unichr', 'unicode', 'xrange']
 else:
     __all__ = []
-
diff --git a/src/past/builtins/noniterators.py b/src/past/builtins/noniterators.py
index 66a4a8a57513e23af48c779b11a2380cd098a46c..5826b97c1e6fbaa37a681fa64914de3ddae5d721 100644
--- a/src/past/builtins/noniterators.py
+++ b/src/past/builtins/noniterators.py
@@ -6,7 +6,7 @@ This module is designed to be used as follows::
 And then, for example::
 
     assert isinstance(range(5), list)
-    
+
 The list-producing functions this brings in are::
 
 - ``filter``
@@ -19,7 +19,7 @@ The list-producing functions this brings in are::
 
 from __future__ import division, absolute_import, print_function
 
-from itertools import chain, starmap    
+from itertools import chain, starmap
 import itertools       # since zip_longest doesn't exist on Py2
 from past.types import basestring
 from past.utils import PY3
@@ -36,7 +36,7 @@ if PY3:
     def oldfilter(*args):
         """
         filter(function or None, sequence) -> list, tuple, or string
-        
+
         Return those items of sequence for which function(item) is true.
         If function is None, return the items that are true.  If sequence
         is a tuple or string, return the same type, else return a list.
@@ -56,7 +56,7 @@ if PY3:
     def oldmap(func, *iterables):
         """
         map(function, sequence[, sequence, ...]) -> list
-        
+
         Return a list of the results of applying the function to the
         items of the argument sequence(s).  If more than one sequence is
         given, the function is called with an argument list consisting of
@@ -64,7 +64,7 @@ if PY3:
         missing values when not all sequences have the same length.  If
         the function is None, return a list of the items of the sequence
         (or a list of tuples if more than one sequence).
-        
+
         Test cases:
         >>> oldmap(None, 'hello world')
         ['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']
@@ -102,22 +102,22 @@ if PY3:
         #         PyObject *it;           /* the iterator object */
         #         int saw_StopIteration;  /* bool:  did the iterator end? */
         #     } sequence;
-        # 
+        #
         #     PyObject *func, *result;
         #     sequence *seqs = NULL, *sqp;
         #     Py_ssize_t n, len;
         #     register int i, j;
-        # 
+        #
         #     n = PyTuple_Size(args);
         #     if (n < 2) {
         #         PyErr_SetString(PyExc_TypeError,
         #                         "map() requires at least two args");
         #         return NULL;
         #     }
-        # 
+        #
         #     func = PyTuple_GetItem(args, 0);
         #     n--;
-        # 
+        #
         #     if (func == Py_None) {
         #         if (PyErr_WarnPy3k("map(None, ...) not supported in 3.x; "
         #                            "use list(...)", 1) < 0)
@@ -127,7 +127,7 @@ if PY3:
         #             return PySequence_List(PyTuple_GetItem(args, 1));
         #         }
         #     }
-        # 
+        #
         #     /* Get space for sequence descriptors.  Must NULL out the iterator
         #      * pointers so that jumping to Fail_2 later doesn't see trash.
         #      */
@@ -139,7 +139,7 @@ if PY3:
         #         seqs[i].it = (PyObject*)NULL;
         #         seqs[i].saw_StopIteration = 0;
         #     }
-        # 
+        #
         #     /* Do a first pass to obtain iterators for the arguments, and set len
         #      * to the largest of their lengths.
         #      */
@@ -147,7 +147,7 @@ if PY3:
         #     for (i = 0, sqp = seqs; i < n; ++i, ++sqp) {
         #         PyObject *curseq;
         #         Py_ssize_t curlen;
-        # 
+        #
         #         /* Get iterator. */
         #         curseq = PyTuple_GetItem(args, i+1);
         #         sqp->it = PyObject_GetIter(curseq);
@@ -159,27 +159,27 @@ if PY3:
         #             PyErr_SetString(PyExc_TypeError, errbuf);
         #             goto Fail_2;
         #         }
-        # 
+        #
         #         /* Update len. */
         #         curlen = _PyObject_LengthHint(curseq, 8);
         #         if (curlen > len)
         #             len = curlen;
         #     }
-        # 
+        #
         #     /* Get space for the result list. */
         #     if ((result = (PyObject *) PyList_New(len)) == NULL)
         #         goto Fail_2;
-        # 
+        #
         #     /* Iterate over the sequences until all have stopped. */
         #     for (i = 0; ; ++i) {
         #         PyObject *alist, *item=NULL, *value;
         #         int numactive = 0;
-        # 
+        #
         #         if (func == Py_None && n == 1)
         #             alist = NULL;
         #         else if ((alist = PyTuple_New(n)) == NULL)
         #             goto Fail_1;
-        # 
+        #
         #         for (j = 0, sqp = seqs; j < n; ++j, ++sqp) {
         #             if (sqp->saw_StopIteration) {
         #                 Py_INCREF(Py_None);
@@ -204,15 +204,15 @@ if PY3:
         #             else
         #                 break;
         #         }
-        # 
+        #
         #         if (!alist)
         #             alist = item;
-        # 
+        #
         #         if (numactive == 0) {
         #             Py_DECREF(alist);
         #             break;
         #         }
-        # 
+        #
         #         if (func == Py_None)
         #             value = alist;
         #         else {
@@ -230,12 +230,12 @@ if PY3:
         #         else if (PyList_SetItem(result, i, value) < 0)
         #             goto Fail_1;
         #     }
-        # 
+        #
         #     if (i < len && PyList_SetSlice(result, i, len, NULL) < 0)
         #         goto Fail_1;
-        # 
+        #
         #     goto Succeed;
-        # 
+        #
         # Fail_1:
         #     Py_DECREF(result);
         # Fail_2:
@@ -270,4 +270,3 @@ else:
     reduce = __builtin__.reduce
     zip = __builtin__.zip
     __all__ = []
-
diff --git a/src/past/translation/__init__.py b/src/past/translation/__init__.py
index 7b21d9f5f10b26c87320d1ecd5cb79bbc111638b..c7ae2b7a081be3c800ef229a4b760cca3d842e6b 100644
--- a/src/past/translation/__init__.py
+++ b/src/past/translation/__init__.py
@@ -28,7 +28,7 @@ You can unregister the hook using::
     >>> from past.translation import remove_hooks
     >>> remove_hooks()
 
-Author: Ed Schofield. 
+Author: Ed Schofield.
 Inspired by and based on ``uprefix`` by Vinay M. Sajip.
 """
 
@@ -220,16 +220,16 @@ def detect_python2(source, pathname):
         # The above fixers made changes, so we conclude it's Python 2 code
         logger.debug('Detected Python 2 code: {0}'.format(pathname))
         with open('/tmp/original_code.py', 'w') as f:
-            f.write('### Original code (detected as py2): %s\n%s' % 
+            f.write('### Original code (detected as py2): %s\n%s' %
                     (pathname, source))
         with open('/tmp/py2_detection_code.py', 'w') as f:
-            f.write('### Code after running py3 detection (from %s)\n%s' % 
+            f.write('### Code after running py3 detection (from %s)\n%s' %
                     (pathname, str(tree)[:-1]))
         return True
     else:
         logger.debug('Detected Python 3 code: {0}'.format(pathname))
         with open('/tmp/original_code.py', 'w') as f:
-            f.write('### Original code (detected as py3): %s\n%s' % 
+            f.write('### Original code (detected as py3): %s\n%s' %
                     (pathname, source))
         try:
             os.remove('/tmp/futurize_code.py')
@@ -359,7 +359,7 @@ class Py2Fixer(object):
                 # Is the test in the next line more or less robust than the
                 # following one? Presumably less ...
                 # ispkg = self.pathname.endswith('__init__.py')
-                
+
                 if self.kind == imp.PKG_DIRECTORY:
                     mod.__path__ = [ os.path.dirname(self.pathname) ]
                     mod.__package__ = fullname
@@ -367,7 +367,7 @@ class Py2Fixer(object):
                     #else, regular module
                     mod.__path__ = []
                     mod.__package__ = fullname.rpartition('.')[0]
-                    
+
                 try:
                     cachename = imp.cache_from_source(self.pathname)
                     if not os.path.exists(cachename):
@@ -396,15 +396,15 @@ class Py2Fixer(object):
                         if detect_python2(source, self.pathname):
                             source = self.transform(source)
                             with open('/tmp/futurized_code.py', 'w') as f:
-                                f.write('### Futurized code (from %s)\n%s' % 
+                                f.write('### Futurized code (from %s)\n%s' %
                                         (self.pathname, source))
 
                         code = compile(source, self.pathname, 'exec')
 
                         dirname = os.path.dirname(cachename)
-                        if not os.path.exists(dirname):
-                            os.makedirs(dirname)
                         try:
+                            if not os.path.exists(dirname):
+                                os.makedirs(dirname)
                             with open(cachename, 'wb') as f:
                                 data = marshal.dumps(code)
                                 f.write(data)
@@ -457,7 +457,7 @@ def detect_hooks():
 class hooks(object):
     """
     Acts as a context manager. Use like this:
-    
+
     >>> from past import translation
     >>> with translation.hooks():
     ...     import mypy2module
@@ -477,7 +477,7 @@ class hooks(object):
 class suspend_hooks(object):
     """
     Acts as a context manager. Use like this:
-    
+
     >>> from past import translation
     >>> translation.install_hooks()
     >>> import http.client
@@ -495,4 +495,3 @@ class suspend_hooks(object):
     def __exit__(self, *args):
         if self.hooks_were_installed:
             install_hooks()
-
diff --git a/src/past/types/__init__.py b/src/past/types/__init__.py
index a31b2646cfd19e55a83904d985bc731fcf7f7ad0..91dd270f2df58514f34de2ebce579ceb88f137bc 100644
--- a/src/past/types/__init__.py
+++ b/src/past/types/__init__.py
@@ -27,4 +27,3 @@ else:
     unicode = str
     # from .unicode import unicode
     __all__ = ['basestring', 'olddict', 'oldstr', 'long', 'unicode']
-
diff --git a/src/past/types/basestring.py b/src/past/types/basestring.py
index 15437bf7c8ce44063e6297b79d0edf51e28889e5..1cab22f6caf84a9dca8e40c0c8f66a807bf317fe 100644
--- a/src/past/types/basestring.py
+++ b/src/past/types/basestring.py
@@ -37,4 +37,3 @@ class basestring(with_metaclass(BaseBaseString)):
 
 
 __all__ = ['basestring']
-
diff --git a/src/past/types/olddict.py b/src/past/types/olddict.py
index b213e28fa9cd9ebf10ac26c334cb832a3d05e5ae..f4f92a26a6b74845129bf2c8658791ee71d4f5e7 100644
--- a/src/past/types/olddict.py
+++ b/src/past/types/olddict.py
@@ -71,7 +71,7 @@ class olddict(with_metaclass(BaseOldDict, _builtin_dict)):
     #         in the keyword argument list.  For example:  dict(one=1, two=2)
 
     #     """
-    #     
+    #
     #     if len(args) == 0:
     #         return super(olddict, cls).__new__(cls)
     #     # Was: elif isinstance(args[0], newbytes):
@@ -85,7 +85,7 @@ class olddict(with_metaclass(BaseOldDict, _builtin_dict)):
     #     else:
     #         value = args[0]
     #     return super(olddict, cls).__new__(cls, value)
-        
+
     def __native__(self):
         """
         Hook for the past.utils.native() function
@@ -94,4 +94,3 @@ class olddict(with_metaclass(BaseOldDict, _builtin_dict)):
 
 
 __all__ = ['olddict']
-
diff --git a/src/past/types/oldstr.py b/src/past/types/oldstr.py
index 1b90e3e11e2fcb744c16dc5752855ce209e2e471..7768d32847c10ebae7c4f25eccc4bcd48c3ef167 100644
--- a/src/past/types/oldstr.py
+++ b/src/past/types/oldstr.py
@@ -32,7 +32,7 @@ def unescape(s):
     def
     """
     return s.encode().decode('unicode_escape')
-    
+
 
 class oldstr(with_metaclass(BaseOldStr, _builtin_bytes)):
     """
@@ -55,14 +55,14 @@ class oldstr(with_metaclass(BaseOldStr, _builtin_bytes)):
     #     bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer
     #     bytes(int) -> bytes object of size given by the parameter initialized with null bytes
     #     bytes() -> empty bytes object
-    #     
+    #
     #     Construct an immutable array of bytes from:
     #       - an iterable yielding integers in range(256)
     #       - a text string encoded using the specified encoding
     #       - any object implementing the buffer API.
     #       - an integer
     #     """
-    #     
+    #
     #     if len(args) == 0:
     #         return super(newbytes, cls).__new__(cls)
     #     # Was: elif isinstance(args[0], newbytes):
@@ -84,7 +84,7 @@ class oldstr(with_metaclass(BaseOldStr, _builtin_bytes)):
     #         if 'errors' in kwargs:
     #             newargs.append(kwargs['errors'])
     #         value = args[0].encode(*newargs)
-    #         ### 
+    #         ###
     #     elif isinstance(args[0], Iterable):
     #         if len(args[0]) == 0:
     #             # What is this?
@@ -101,7 +101,7 @@ class oldstr(with_metaclass(BaseOldStr, _builtin_bytes)):
     #     else:
     #         value = args[0]
     #     return super(newbytes, cls).__new__(cls, value)
-        
+
     def __repr__(self):
         s = super(oldstr, self).__repr__()   # e.g. b'abc' on Py3, b'abc' on Py3
         return s[1:]
@@ -124,7 +124,7 @@ class oldstr(with_metaclass(BaseOldStr, _builtin_bytes)):
     def __contains__(self, key):
         if isinstance(key, int):
             return False
-    
+
     def __native__(self):
         return bytes(self)
 
diff --git a/src/past/utils/__init__.py b/src/past/utils/__init__.py
index 02f06d5957a70e0187650ba6f6e188c0b2903e72..c6606d0b984a4a167516869d9e2fd30400840539 100644
--- a/src/past/utils/__init__.py
+++ b/src/past/utils/__init__.py
@@ -26,13 +26,13 @@ def with_metaclass(meta, *bases):
     Function from jinja2/_compat.py. License: BSD.
 
     Use it like this::
-        
+
         class BaseForm(object):
             pass
-        
+
         class FormType(type):
             pass
-        
+
         class Form(with_metaclass(FormType, BaseForm)):
             pass
 
@@ -42,7 +42,7 @@ def with_metaclass(meta, *bases):
     we also need to make sure that we downgrade the custom metaclass
     for one level to something closer to type (that's why __call__ and
     __init__ comes back from type etc.).
-    
+
     This has the advantage over six.with_metaclass of not introducing
     dummy classes into the final MRO.
     """
@@ -62,7 +62,7 @@ def native(obj):
 
     On Py3, returns the corresponding native Py3 types that are
     superclasses for forward-ported objects from Py2:
-    
+
     >>> from past.builtins import str, dict
 
     >>> native(str(b'ABC'))   # Output on Py3 follows. On Py2, output is 'ABC'
diff --git a/src/tkinter/__init__.py b/src/tkinter/__init__.py
index d0e1b0afec9c3f0f3d952ab80d628b9ce6bf7ff1..bb730c3567cd5ce52c1dac8fa29c53c1926d7b77 100644
--- a/src/tkinter/__init__.py
+++ b/src/tkinter/__init__.py
@@ -3,9 +3,25 @@ import sys
 
 if sys.version_info[0] < 3:
     from Tkinter import *
-    from Tkinter import (_cnfmerge, _default_root, _flatten, _join, _setit,
-                         _splitdict, _stringify, _support_default_root, _test,
-                         _tkinter)
+    from Tkinter import (_cnfmerge, _default_root, _flatten,
+                          _support_default_root, _test,
+                         _tkinter, _setit)
+
+    try: # >= 2.7.4
+        from Tkinter import (_join) 
+    except ImportError: 
+        pass
+
+    try: # >= 2.7.4
+        from Tkinter import (_stringify)
+    except ImportError: 
+        pass
+
+    try: # >= 2.7.9
+        from Tkinter import (_splitdict)
+    except ImportError:
+        pass
+
 else:
     raise ImportError('This package should not be accessible on Python 3. '
                       'Either you are trying to run from the python-future src folder '
diff --git a/src/tkinter/colorchooser.py b/src/tkinter/colorchooser.py
index 5e7c97f4449dffd07008dba88cd6bfc06cab8413..6dde6e8d300184857b92eb94a7e83ac1fe14d904 100644
--- a/src/tkinter/colorchooser.py
+++ b/src/tkinter/colorchooser.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The tkColorChooser module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/tkinter/commondialog.py b/src/tkinter/commondialog.py
index 7747a0ba0b05d8140976907df9d64202702d3e37..eb7ae8d6076170bd3a72ca5c37a3a3d80c03afa2 100644
--- a/src/tkinter/commondialog.py
+++ b/src/tkinter/commondialog.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The tkCommonDialog module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/tkinter/constants.py b/src/tkinter/constants.py
index 99216f33d0a08a0d66a3aff9517ffb1a58cb9dba..ffe098152f11fb8310f96754d260154dcf7ab41c 100644
--- a/src/tkinter/constants.py
+++ b/src/tkinter/constants.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The Tkconstants module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/tkinter/dialog.py b/src/tkinter/dialog.py
index a5b777815a3a39ba3e0a906c2cab5856b0471e7c..113370ca2cbf7dd5beff1f510951c95bbe142a91 100644
--- a/src/tkinter/dialog.py
+++ b/src/tkinter/dialog.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The Dialog module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/tkinter/dnd.py b/src/tkinter/dnd.py
index 748b111a2b619d5e2d4ac62f51f924bd8833dcd6..1ab437917d9e2cb0253846f6023031fea821adcd 100644
--- a/src/tkinter/dnd.py
+++ b/src/tkinter/dnd.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The Tkdnd module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/tkinter/font.py b/src/tkinter/font.py
index 63d86dc73c02c12bfee2035b75926104fce56009..628f399a35b9d201c40ece3430890ad01b513265 100644
--- a/src/tkinter/font.py
+++ b/src/tkinter/font.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The tkFont module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/tkinter/messagebox.py b/src/tkinter/messagebox.py
index 3ed52e1fecfb3b787a86236c54bbecc195a15dc3..b43d8702f59d714817786c82262357598102c6f8 100644
--- a/src/tkinter/messagebox.py
+++ b/src/tkinter/messagebox.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The tkMessageBox module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/tkinter/scrolledtext.py b/src/tkinter/scrolledtext.py
index 13bd660d96f4b72612d2c04d936dd81dc95963cc..1c69db60672ddd94467360cef644c2bfe8640066 100644
--- a/src/tkinter/scrolledtext.py
+++ b/src/tkinter/scrolledtext.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The ScrolledText module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/tkinter/simpledialog.py b/src/tkinter/simpledialog.py
index e952fa994e4e6fe97affc20171b175c6b7dbe67d..dba93fbf259e1ff64c7dcf893de872861f9a6d8b 100644
--- a/src/tkinter/simpledialog.py
+++ b/src/tkinter/simpledialog.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The SimpleDialog module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/tkinter/tix.py b/src/tkinter/tix.py
index 019df6f73f8fa3d683ca7a3b18a8a23c95f33c39..8d1718ad0b717b79380860609e9c392c1ee219de 100644
--- a/src/tkinter/tix.py
+++ b/src/tkinter/tix.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The Tix module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/src/tkinter/ttk.py b/src/tkinter/ttk.py
index 22ac9774c46ee350976bcae83421a69526911b1f..081c1b49562b61e529313a1b6588b7b42ceb4c94 100644
--- a/src/tkinter/ttk.py
+++ b/src/tkinter/ttk.py
@@ -10,4 +10,3 @@ else:
     except ImportError:
         raise ImportError('The ttk module is missing. Does your Py2 '
                           'installation include tkinter?')
-
diff --git a/tests/test_future/test_bytes.py b/tests/test_future/test_bytes.py
index 5254a9becec456d5b8305f823f8626cba71191bc..bb90a71c4a74cc76731ca51f469f73eed66caa11 100644
--- a/tests/test_future/test_bytes.py
+++ b/tests/test_future/test_bytes.py
@@ -160,7 +160,7 @@ class TestBytes(unittest.TestCase):
 
     def test_str(self):
         b = bytes(b'ABCD')
-        self.assertTrue(str(b), "b'ABCD'")
+        self.assertEqual(str(b), "b'ABCD'")
 
     def test_bytes_setitem(self):
         b = b'ABCD'
@@ -552,37 +552,83 @@ class TestBytes(unittest.TestCase):
         self.assertRaises(ValueError, bytes.maketrans, b'abc', b'xyzq')
         self.assertRaises(TypeError, bytes.maketrans, 'abc', 'def')
 
-    # def test_mod(self):
-    #     """
-    #     From Py3.5 test suite (post-PEP 461).
-    #
-    #     The bytes mod code is in _PyBytes_Format() in bytesobject.c in Py3.5.
-    #     """
-    #     b = b'hello, %b!'
-    #     orig = b
-    #     b = b % b'world'
-    #     self.assertEqual(b, b'hello, world!')
-    #     self.assertEqual(orig, b'hello, %b!')
-    #     self.assertFalse(b is orig)
-    #     b = b'%s / 100 = %d%%'
-    #     a = b % (b'seventy-nine', 79)
-    #     self.assertEqual(a, b'seventy-nine / 100 = 79%')
-
-    # def test_imod(self):
-    #     """
-    #     From Py3.5 test suite (post-PEP 461)
-    #     """
-    #     # if (3, 0) <= sys.version_info[:2] < (3, 5):
-    #     #     raise unittest.SkipTest('bytes % not yet implemented on Py3.0-3.4')
-    #     b = bytes(b'hello, %b!')
-    #     orig = b
-    #     b %= b'world'
-    #     self.assertEqual(b, b'hello, world!')
-    #     self.assertEqual(orig, b'hello, %b!')
-    #     self.assertFalse(b is orig)
-    #     b = bytes(b'%s / 100 = %d%%')
-    #     b %= (b'seventy-nine', 79)
-    #     self.assertEqual(b, b'seventy-nine / 100 = 79%')
+    @unittest.skipUnless(utils.PY2, 'test requires Python 2')
+    def test_mod_custom_dict(self):
+        import UserDict
+
+        class MyDict(UserDict.UserDict):
+            pass
+
+        d = MyDict()
+        d['foo'] = bytes(b'bar')
+        self.assertFalse(isinstance(d, dict))
+        self.assertTrue(isinstance(d, UserDict.UserDict))
+
+        self.assertEqual(bytes(b'%(foo)s') % d, b'bar')
+
+    @unittest.skipUnless(utils.PY35_PLUS or utils.PY2,
+                         'test requires Python 2 or 3.5+')
+    def test_mod_more(self):
+        self.assertEqual(b'%s' % b'aaa', b'aaa')
+        self.assertEqual(bytes(b'%s') % b'aaa', b'aaa')
+        self.assertEqual(bytes(b'%s') % bytes(b'aaa'), b'aaa')
+
+        self.assertEqual(b'%s' % (b'aaa',), b'aaa')
+        self.assertEqual(bytes(b'%s') % (b'aaa',), b'aaa')
+        self.assertEqual(bytes(b'%s') % (bytes(b'aaa'),), b'aaa')
+
+        self.assertEqual(bytes(b'%(x)s') % {b'x': b'aaa'}, b'aaa')
+        self.assertEqual(bytes(b'%(x)s') % {b'x': bytes(b'aaa')}, b'aaa')
+
+    @unittest.skipUnless(utils.PY35_PLUS or utils.PY2,
+                         'test requires Python 2 or 3.5+')
+    def test_mod(self):
+        """
+        From Py3.5 test suite (post-PEP 461).
+
+        The bytes mod code is in _PyBytes_Format() in bytesobject.c in Py3.5.
+        """
+
+        # XXX Add support for %b!
+        #
+        # b = bytes(b'hello, %b!')
+        # orig = b
+        # b = b % b'world'
+        # self.assertEqual(b, b'hello, world!')
+        # self.assertEqual(orig, b'hello, %b!')
+        # self.assertFalse(b is orig)
+
+        b = bytes(b'%s / 100 = %d%%')
+        a = b % (b'seventy-nine', 79)
+        self.assertEqual(a, b'seventy-nine / 100 = 79%')
+
+        b = bytes(b'%s / 100 = %d%%')
+        a = b % (bytes(b'seventy-nine'), 79)
+        self.assertEqual(a, b'seventy-nine / 100 = 79%')
+
+    @unittest.skipUnless(utils.PY35_PLUS or utils.PY2,
+                         'test requires Python 2 or 3.5+')
+    def test_imod(self):
+        """
+        From Py3.5 test suite (post-PEP 461)
+        """
+        # if (3, 0) <= sys.version_info[:2] < (3, 5):
+        #     raise unittest.SkipTest('bytes % not yet implemented on Py3.0-3.4')
+
+        # b = bytes(b'hello, %b!')
+        # orig = b
+        # b %= b'world'
+        # self.assertEqual(b, b'hello, world!')
+        # self.assertEqual(orig, b'hello, %b!')
+        # self.assertFalse(b is orig)
+
+        b = bytes(b'%s / 100 = %d%%')
+        b %= (b'seventy-nine', 79)
+        self.assertEqual(b, b'seventy-nine / 100 = 79%')
+
+        b = bytes(b'%s / 100 = %d%%')
+        b %= (bytes(b'seventy-nine'), 79)
+        self.assertEqual(b, b'seventy-nine / 100 = 79%')
 
     # def test_mod_pep_461(self):
     #     """
@@ -707,6 +753,31 @@ class TestBytes(unittest.TestCase):
         b = nativebytes(bytes(b'asdf'))
         self.assertEqual(b, b'asdf')
 
+    def test_cast_to_bytes(self):
+        """
+        Tests whether __bytes__ method is called
+        """
+
+        class TestObject:
+            def __bytes__(self):
+                return b'asdf'
+
+        self.assertEqual(bytes(TestObject()), b'asdf')
+
+    def test_cast_to_bytes_iter_precedence(self):
+        """
+        Tests that call to __bytes__ is preferred to iteration
+        """
+
+        class TestObject:
+            def __bytes__(self):
+                return b'asdf'
+
+            def __iter__(self):
+                return iter(b'hjkl')
+
+        self.assertEqual(bytes(TestObject()), b'asdf')
+
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/tests/test_future/test_chainmap.py b/tests/test_future/test_chainmap.py
new file mode 100644
index 0000000000000000000000000000000000000000..2440401bdb953edf4a6c26ba9b3b510baa1e72d3
--- /dev/null
+++ b/tests/test_future/test_chainmap.py
@@ -0,0 +1,160 @@
+"""
+Tests for the future.standard_library module
+"""
+
+from __future__ import absolute_import, print_function
+from future import standard_library
+from future import utils
+from future.tests.base import unittest, CodeHandler, expectedFailurePY2
+
+import sys
+import tempfile
+import os
+import copy
+import textwrap
+from subprocess import CalledProcessError
+
+
+class TestChainMap(CodeHandler):
+
+    def setUp(self):
+        self.interpreter = sys.executable
+        standard_library.install_aliases()
+        super(TestChainMap, self).setUp()
+
+    def tearDown(self):
+        # standard_library.remove_hooks()
+        pass
+
+    @staticmethod
+    def simple_cm():
+        from collections import ChainMap
+        c = ChainMap()
+        c['one'] = 1
+        c['two'] = 2
+    
+        cc = c.new_child()
+        cc['one'] = 'one'
+    
+        return c, cc
+    
+    
+    def test_repr(self):
+        c, cc = TestChainMap.simple_cm()
+    
+        order1 = "ChainMap({'one': 'one'}, {'one': 1, 'two': 2})"
+        order2 = "ChainMap({'one': 'one'}, {'two': 2, 'one': 1})"
+        assert repr(cc) in [order1, order2]
+    
+    
+    def test_recursive_repr(self):
+        """
+        Test for degnerative recursive cases. Very unlikely in
+        ChainMaps. But all must bow before the god of testing coverage.
+        """
+        from collections import ChainMap
+        c = ChainMap()
+        c['one'] = c
+        assert repr(c) == "ChainMap({'one': ...})"
+    
+    
+    def test_get(self):
+        c, cc = TestChainMap.simple_cm()
+    
+        assert cc.get('two') == 2
+        assert cc.get('three') == None
+        assert cc.get('three', 'notthree') == 'notthree'
+    
+    
+    def test_bool(self):
+        from collections import ChainMap
+        c = ChainMap()
+        assert not(bool(c))
+    
+        c['one'] = 1
+        c['two'] = 2
+        assert bool(c)
+    
+        cc = c.new_child()
+        cc['one'] = 'one'
+        assert cc
+    
+    
+    def test_fromkeys(self):
+        from collections import ChainMap
+        keys = 'a b c'.split()
+        c = ChainMap.fromkeys(keys)
+        assert len(c) == 3
+        assert c['a'] == None
+        assert c['b'] == None
+        assert c['c'] == None
+    
+    
+    def test_copy(self):
+        c, cc = TestChainMap.simple_cm()
+        new_cc = cc.copy()
+        assert new_cc is not cc
+        assert sorted(new_cc.items()) == sorted(cc.items())
+    
+    
+    def test_parents(self):
+        c, cc = TestChainMap.simple_cm()
+    
+        new_c = cc.parents
+        assert c is not new_c
+        assert len(new_c) == 2
+        assert new_c['one'] == c['one']
+        assert new_c['two'] == c['two']
+    
+    
+    def test_delitem(self):
+        c, cc = TestChainMap.simple_cm()
+    
+        with self.assertRaises(KeyError):
+            del cc['two']
+    
+        del cc['one']
+        assert len(cc) == 2
+        assert cc['one'] == 1
+        assert cc['two'] == 2
+    
+    
+    def test_popitem(self):
+        c, cc = TestChainMap.simple_cm()
+    
+        assert cc.popitem() == ('one', 'one')
+    
+        with self.assertRaises(KeyError):
+            cc.popitem()
+    
+    
+    def test_pop(self):
+        c, cc = TestChainMap.simple_cm()
+    
+        assert cc.pop('one') == 'one'
+    
+        with self.assertRaises(KeyError):
+            cc.pop('two')
+    
+        assert len(cc) == 2
+    
+    
+    def test_clear(self):
+        c, cc = TestChainMap.simple_cm()
+    
+        cc.clear()
+        assert len(cc) == 2
+        assert cc['one'] == 1
+        assert cc['two'] == 2
+    
+    
+    def test_missing(self):
+    
+        c, cc = TestChainMap.simple_cm()
+    
+        with self.assertRaises(KeyError):
+            cc['clown']
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/tests/test_future/test_decorators.py b/tests/test_future/test_decorators.py
index 428fb8a3052063f8825cfdf2e57d26a12791c781..9ec2bb37c417cd45344fd0c0dd674e8aa7b1839d 100644
--- a/tests/test_future/test_decorators.py
+++ b/tests/test_future/test_decorators.py
@@ -36,14 +36,14 @@ class TestDecorators(unittest.TestCase):
             assert str(a) == str(b)
 
     def test_implements_iterator(self):
-        
+
         @implements_iterator
         class MyIter(object):
             def __next__(self):
                 return 'Next!'
             def __iter__(self):
                 return self
-        
+
         itr = MyIter()
         self.assertEqual(next(itr), 'Next!')
 
diff --git a/tests/test_future/test_futurize.py b/tests/test_future/test_futurize.py
index f3fe0b848d81522690f6a7dd118ec96472a17b3e..5549a010c8fe7c87521b38269c5eb67f32b09b83 100644
--- a/tests/test_future/test_futurize.py
+++ b/tests/test_future/test_futurize.py
@@ -123,6 +123,17 @@ class TestFuturizeSimple(CodeHandler):
         """
         self.convert_check(before, after)
 
+    def test_multiline_future_import(self):
+        """
+        Issue #113: don't crash if a future import has multiple lines
+        """
+        text = """
+        from __future__ import (
+            division
+        )
+        """
+        self.convert(text)
+
     def test_shebang_blank_with_future_division_import(self):
         """
         Issue #43: Is shebang line preserved as the first
@@ -441,7 +452,7 @@ class TestFuturizeSimple(CodeHandler):
             pass
         """
         self.convert_check(before, after, ignore_imports=False)
-    
+
     def test_source_coding_utf8(self):
         """
         Tests to ensure that the source coding line is not corrupted or
@@ -506,13 +517,13 @@ class TestFuturizeSimple(CodeHandler):
         before = '''
         def addup(*x):
             return sum(x)
-        
+
         assert apply(addup, (10,20)) == 30
         '''
         after = """
         def addup(*x):
             return sum(x)
-        
+
         assert addup(*(10,20)) == 30
         """
         self.convert_check(before, after)
@@ -651,7 +662,7 @@ class TestFuturizeRenamedStdlib(CodeHandler):
         from future import standard_library
         standard_library.install_aliases()
         import urllib.request
-        
+
         URL = 'http://pypi.python.org/pypi/future/json'
         package = 'future'
         r = urllib.request.urlopen(URL.format(package))
@@ -1034,13 +1045,13 @@ class TestFuturizeStage1(CodeHandler):
         #
         # another comment
         #
-        
+
         CONSTANTS = [ 0, 01, 011, 0111, 012, 02, 021, 0211, 02111, 013 ]
         _RN_LETTERS = "IVXLCDM"
-        
+
         def my_func(value):
             pass
-        
+
         ''' Docstring-like comment here '''
         """
         self.convert(code)
@@ -1170,18 +1181,74 @@ class TestFuturizeStage1(CodeHandler):
         after futurization.
         """
         before = """
+        import random
+        class fraction(object):
+            numer = 0
+            denom = 0
+            def __init__(self, numer, denom):
+                self.numer = numer
+                self.denom = denom
+
+            def total_count(self):
+                return self.numer * 50
+
         x = 3 / 2
         y = 3. / 2
+        foo = list(range(100))
         assert x == 1 and isinstance(x, int)
         assert y == 1.5 and isinstance(y, float)
+        a = 1 + foo[len(foo) / 2]
+        b = 1 + foo[len(foo) * 3 / 4]
+        assert a == 51
+        assert b == 76
+        r = random.randint(0, 1000) * 1.0 / 1000
+        output = { "SUCCESS": 5, "TOTAL": 10 }
+        output["SUCCESS"] * 100 / output["TOTAL"]
+        obj = fraction(1, 50)
+        val = float(obj.numer) / obj.denom * 1e-9
+        obj.numer * obj.denom / val
+        obj.total_count() * val / 100
+        original_numer = 1
+        original_denom = 50
+        100 * abs(obj.numer - original_numer) / float(max(obj.denom, original_denom))
+        100 * abs(obj.numer - original_numer) / max(obj.denom, original_denom)
+        float(original_numer) * float(original_denom) / float(obj.numer)
         """
         after = """
         from __future__ import division
         from past.utils import old_div
+        import random
+        class fraction(object):
+            numer = 0
+            denom = 0
+            def __init__(self, numer, denom):
+                self.numer = numer
+                self.denom = denom
+
+            def total_count(self):
+                return self.numer * 50
+
         x = old_div(3, 2)
-        y = old_div(3., 2)
+        y = 3. / 2
+        foo = list(range(100))
         assert x == 1 and isinstance(x, int)
         assert y == 1.5 and isinstance(y, float)
+        a = 1 + foo[old_div(len(foo), 2)]
+        b = 1 + foo[old_div(len(foo) * 3, 4)]
+        assert a == 51
+        assert b == 76
+        r = old_div(random.randint(0, 1000) * 1.0, 1000)
+        output = { "SUCCESS": 5, "TOTAL": 10 }
+        old_div(output["SUCCESS"] * 100, output["TOTAL"])
+        obj = fraction(1, 50)
+        val = float(obj.numer) / obj.denom * 1e-9
+        old_div(obj.numer * obj.denom, val)
+        old_div(obj.total_count() * val, 100)
+        original_numer = 1
+        original_denom = 50
+        100 * abs(obj.numer - original_numer) / float(max(obj.denom, original_denom))
+        old_div(100 * abs(obj.numer - original_numer), max(obj.denom, original_denom))
+        float(original_numer) * float(original_denom) / float(obj.numer)
         """
         self.convert_check(before, after)
 
diff --git a/tests/test_future/test_httplib.py b/tests/test_future/test_httplib.py
index 968e9339c7f578c74e9989a8901ba28c79cf8817..a1e2b19a40bc71185df0eab57f8f74a654caddf9 100644
--- a/tests/test_future/test_httplib.py
+++ b/tests/test_future/test_httplib.py
@@ -197,7 +197,7 @@ class BasicTest(TestCase):
         if not utils.PY3:
             self.assertEqual(repr(exc), '''BadStatusLine("u\'\'",)''')
         else:
-            self.assertEqual(repr(exc), '''BadStatusLine("\'\'",)''')
+            self.assertIn(repr(exc), ('''BadStatusLine("''",)''', '''BadStatusLine("''")'''))
 
     def test_partial_reads(self):
         # if we have a length, the system knows when to close itself
diff --git a/tests/test_future/test_int.py b/tests/test_future/test_int.py
index f1d9c5d898208c36967cb5b935bf262334025548..9acbd23a2a6620f5b3e3ed0113004ea86ab164b2 100644
--- a/tests/test_future/test_int.py
+++ b/tests/test_future/test_int.py
@@ -265,12 +265,17 @@ class IntTestCases(unittest.TestCase):
     def test_no_args(self):
         self.assertEqual(int(), 0)
 
-    def test_keyword_args(self):
+    @unittest.skipIf(sys.version_info >= (3, 7),
+            "The first parameter must be positional with Python >= 3.7"
+    )
+    def test_x_keyword_arg(self):
         # Test invoking int() using keyword arguments.
         self.assertEqual(int(x=1.2), 1)
-        self.assertEqual(int('100', base=2), 4)
         self.assertEqual(int(x='100', base=2), 4)
 
+    def text_base_keyword_arg(self):
+        self.assertEqual(int('100', base=2), 4)
+
     def test_newint_plus_float(self):
         minutes = int(100)
         second = 0.0
diff --git a/tests/test_future/test_libfuturize_fixers.py b/tests/test_future/test_libfuturize_fixers.py
index c7fa8ddcd5406e244f952b84c82e06e9402b6029..8c4a9a3e391f0af2821e4340518f2ada2b3c94f1 100644
--- a/tests/test_future/test_libfuturize_fixers.py
+++ b/tests/test_future/test_libfuturize_fixers.py
@@ -25,7 +25,7 @@ proj_dir = os.path.normpath(os.path.join(test_dir, ".."))
 # grammar_path = os.path.join(test_dir, "..", "Grammar.txt")
 # grammar = driver.load_grammar(grammar_path)
 # driver = driver.Driver(grammar, convert=pytree.convert)
-# 
+#
 # def parse_string(string):
 #     return driver.parse_string(reformat(string), debug=True)
 
@@ -118,118 +118,118 @@ class FixerTestCase(unittest.TestCase):
 
 
 ############### EDIT the tests below ...
-# 
+#
 # class Test_ne(FixerTestCase):
 #     fixer = "ne"
-# 
+#
 #     def test_basic(self):
 #         b = """if x <> y:
 #             pass"""
-# 
+#
 #         a = """if x != y:
 #             pass"""
 #         self.check(b, a)
-# 
-# 
+#
+#
 # class Test_print(FixerTestCase):
 #     fixer = "print_"
-# 
+#
 #     def test_print(self):
 #         b = """print 'Hello world'"""
 #         a = """from __future__ import print_function\nprint('Hello world')"""
 #         self.check(b, a)
-# 
-# 
+#
+#
 # class Test_apply(FixerTestCase):
 #     fixer = "apply"
-# 
+#
 #     def test_1(self):
 #         b = """x = apply(f, g + h)"""
 #         a = """x = f(*g + h)"""
 #         self.check(b, a)
-# 
-# 
+#
+#
 # class Test_intern(FixerTestCase):
 #     fixer = "intern"
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = """x =   intern(  a  )"""
 #         a = """import sys\nx =   sys.intern(  a  )"""
 #         self.check(b, a)
-# 
+#
 #         b = """y = intern("b" # test
 #               )"""
 #         a = """import sys\ny = sys.intern("b" # test
 #               )"""
 #         self.check(b, a)
-# 
+#
 #         b = """z = intern(a+b+c.d,   )"""
 #         a = """import sys\nz = sys.intern(a+b+c.d,   )"""
 #         self.check(b, a)
-# 
+#
 #     def test(self):
 #         b = """x = intern(a)"""
 #         a = """import sys\nx = sys.intern(a)"""
 #         self.check(b, a)
-# 
+#
 #         b = """z = intern(a+b+c.d,)"""
 #         a = """import sys\nz = sys.intern(a+b+c.d,)"""
 #         self.check(b, a)
-# 
+#
 #         b = """intern("y%s" % 5).replace("y", "")"""
 #         a = """import sys\nsys.intern("y%s" % 5).replace("y", "")"""
 #         self.check(b, a)
-# 
+#
 #     # These should not be refactored
-# 
+#
 #     def test_unchanged(self):
 #         s = """intern(a=1)"""
 #         self.unchanged(s)
-# 
+#
 #         s = """intern(f, g)"""
 #         self.unchanged(s)
-# 
+#
 #         s = """intern(*h)"""
 #         self.unchanged(s)
-# 
+#
 #         s = """intern(**i)"""
 #         self.unchanged(s)
-# 
+#
 #         s = """intern()"""
 #         self.unchanged(s)
-# 
+#
 # class Test_reduce(FixerTestCase):
 #     fixer = "reduce"
-# 
+#
 #     def test_simple_call(self):
 #         b = "reduce(a, b, c)"
 #         a = "from functools import reduce\nreduce(a, b, c)"
 #         self.check(b, a)
-# 
+#
 #     def test_bug_7253(self):
 #         # fix_tuple_params was being bad and orphaning nodes in the tree.
 #         b = "def x(arg): reduce(sum, [])"
 #         a = "from functools import reduce\ndef x(arg): reduce(sum, [])"
 #         self.check(b, a)
-# 
+#
 #     def test_call_with_lambda(self):
 #         b = "reduce(lambda x, y: x + y, seq)"
 #         a = "from functools import reduce\nreduce(lambda x, y: x + y, seq)"
 #         self.check(b, a)
-# 
+#
 #     def test_unchanged(self):
 #         s = "reduce(a)"
 #         self.unchanged(s)
-# 
+#
 #         s = "reduce(a, b=42)"
 #         self.unchanged(s)
-# 
+#
 #         s = "reduce(a, b, c, d)"
 #         self.unchanged(s)
-# 
+#
 #         s = "reduce(**c)"
 #         self.unchanged(s)
-# 
+#
 #         s = "reduce()"
 #         self.unchanged(s)
 
@@ -341,96 +341,96 @@ class Test_print(FixerTestCase):
 
 # class Test_exec(FixerTestCase):
 #     fixer = "exec"
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = """  exec code in ns1,   ns2"""
 #         a = """  exec(code, ns1,   ns2)"""
 #         self.check(b, a)
-# 
+#
 #     def test_basic(self):
 #         b = """exec code"""
 #         a = """exec(code)"""
 #         self.check(b, a)
-# 
+#
 #     def test_with_globals(self):
 #         b = """exec code in ns"""
 #         a = """exec(code, ns)"""
 #         self.check(b, a)
-# 
+#
 #     def test_with_globals_locals(self):
 #         b = """exec code in ns1, ns2"""
 #         a = """exec(code, ns1, ns2)"""
 #         self.check(b, a)
-# 
+#
 #     def test_complex_1(self):
 #         b = """exec (a.b()) in ns"""
 #         a = """exec((a.b()), ns)"""
 #         self.check(b, a)
-# 
+#
 #     def test_complex_2(self):
 #         b = """exec a.b() + c in ns"""
 #         a = """exec(a.b() + c, ns)"""
 #         self.check(b, a)
-# 
+#
 #     # These should not be touched
-# 
+#
 #     def test_unchanged_1(self):
 #         s = """exec(code)"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_2(self):
 #         s = """exec (code)"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_3(self):
 #         s = """exec(code, ns)"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_4(self):
 #         s = """exec(code, ns1, ns2)"""
 #         self.unchanged(s)
-# 
+#
 # class Test_repr(FixerTestCase):
 #     fixer = "repr"
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = """x =   `1 + 2`"""
 #         a = """x =   repr(1 + 2)"""
 #         self.check(b, a)
-# 
+#
 #     def test_simple_1(self):
 #         b = """x = `1 + 2`"""
 #         a = """x = repr(1 + 2)"""
 #         self.check(b, a)
-# 
+#
 #     def test_simple_2(self):
 #         b = """y = `x`"""
 #         a = """y = repr(x)"""
 #         self.check(b, a)
-# 
+#
 #     def test_complex(self):
 #         b = """z = `y`.__repr__()"""
 #         a = """z = repr(y).__repr__()"""
 #         self.check(b, a)
-# 
+#
 #     def test_tuple(self):
 #         b = """x = `1, 2, 3`"""
 #         a = """x = repr((1, 2, 3))"""
 #         self.check(b, a)
-# 
+#
 #     def test_nested(self):
 #         b = """x = `1 + `2``"""
 #         a = """x = repr(1 + repr(2))"""
 #         self.check(b, a)
-# 
+#
 #     def test_nested_tuples(self):
 #         b = """x = `1, 2 + `3, 4``"""
 #         a = """x = repr((1, 2 + repr((3, 4))))"""
 #         self.check(b, a)
-# 
+#
 # class Test_except(FixerTestCase):
 #     fixer = "except"
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = """
 #             try:
@@ -443,7 +443,7 @@ class Test_print(FixerTestCase):
 #             except (RuntimeError, ImportError) as    e:
 #                 pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_simple(self):
 #         b = """
 #             try:
@@ -456,7 +456,7 @@ class Test_print(FixerTestCase):
 #             except Foo as e:
 #                 pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_simple_no_space_before_target(self):
 #         b = """
 #             try:
@@ -469,7 +469,7 @@ class Test_print(FixerTestCase):
 #             except Foo as e:
 #                 pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_tuple_unpack(self):
 #         b = """
 #             def foo():
@@ -479,7 +479,7 @@ class Test_print(FixerTestCase):
 #                     pass
 #                 except ImportError, e:
 #                     pass"""
-# 
+#
 #         a = """
 #             def foo():
 #                 try:
@@ -490,28 +490,28 @@ class Test_print(FixerTestCase):
 #                 except ImportError as e:
 #                     pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_multi_class(self):
 #         b = """
 #             try:
 #                 pass
 #             except (RuntimeError, ImportError), e:
 #                 pass"""
-# 
+#
 #         a = """
 #             try:
 #                 pass
 #             except (RuntimeError, ImportError) as e:
 #                 pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_list_unpack(self):
 #         b = """
 #             try:
 #                 pass
 #             except Exception, [a, b]:
 #                 pass"""
-# 
+#
 #         a = """
 #             try:
 #                 pass
@@ -519,14 +519,14 @@ class Test_print(FixerTestCase):
 #                 [a, b] = xxx_todo_changeme.args
 #                 pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_weird_target_1(self):
 #         b = """
 #             try:
 #                 pass
 #             except Exception, d[5]:
 #                 pass"""
-# 
+#
 #         a = """
 #             try:
 #                 pass
@@ -534,14 +534,14 @@ class Test_print(FixerTestCase):
 #                 d[5] = xxx_todo_changeme
 #                 pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_weird_target_2(self):
 #         b = """
 #             try:
 #                 pass
 #             except Exception, a.foo:
 #                 pass"""
-# 
+#
 #         a = """
 #             try:
 #                 pass
@@ -549,14 +549,14 @@ class Test_print(FixerTestCase):
 #                 a.foo = xxx_todo_changeme
 #                 pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_weird_target_3(self):
 #         b = """
 #             try:
 #                 pass
 #             except Exception, a().foo:
 #                 pass"""
-# 
+#
 #         a = """
 #             try:
 #                 pass
@@ -564,7 +564,7 @@ class Test_print(FixerTestCase):
 #                 a().foo = xxx_todo_changeme
 #                 pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_bare_except(self):
 #         b = """
 #             try:
@@ -573,7 +573,7 @@ class Test_print(FixerTestCase):
 #                 pass
 #             except:
 #                 pass"""
-# 
+#
 #         a = """
 #             try:
 #                 pass
@@ -582,7 +582,7 @@ class Test_print(FixerTestCase):
 #             except:
 #                 pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_bare_except_and_else_finally(self):
 #         b = """
 #             try:
@@ -595,7 +595,7 @@ class Test_print(FixerTestCase):
 #                 pass
 #             finally:
 #                 pass"""
-# 
+#
 #         a = """
 #             try:
 #                 pass
@@ -608,7 +608,7 @@ class Test_print(FixerTestCase):
 #             finally:
 #                 pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_multi_fixed_excepts_before_bare_except(self):
 #         b = """
 #             try:
@@ -619,7 +619,7 @@ class Test_print(FixerTestCase):
 #                 pass
 #             except:
 #                 pass"""
-# 
+#
 #         a = """
 #             try:
 #                 pass
@@ -630,7 +630,7 @@ class Test_print(FixerTestCase):
 #             except:
 #                 pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_one_line_suites(self):
 #         b = """
 #             try: raise TypeError
@@ -676,9 +676,9 @@ class Test_print(FixerTestCase):
 #             finally: done()
 #             """
 #         self.check(b, a)
-# 
+#
 #     # These should not be touched:
-# 
+#
 #     def test_unchanged_1(self):
 #         s = """
 #             try:
@@ -686,7 +686,7 @@ class Test_print(FixerTestCase):
 #             except:
 #                 pass"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_2(self):
 #         s = """
 #             try:
@@ -694,7 +694,7 @@ class Test_print(FixerTestCase):
 #             except Exception:
 #                 pass"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_3(self):
 #         s = """
 #             try:
@@ -702,87 +702,87 @@ class Test_print(FixerTestCase):
 #             except (Exception, SystemExit):
 #                 pass"""
 #         self.unchanged(s)
-# 
+#
 # class Test_raise(FixerTestCase):
 #     fixer = "raise"
-# 
+#
 #     def test_basic(self):
 #         b = """raise Exception, 5"""
 #         a = """raise Exception(5)"""
 #         self.check(b, a)
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = """raise Exception,5"""
 #         a = """raise Exception(5)"""
 #         self.check(b, a)
-# 
+#
 #         b = """raise   Exception,    5"""
 #         a = """raise   Exception(5)"""
 #         self.check(b, a)
-# 
+#
 #     def test_with_comments(self):
 #         b = """raise Exception, 5 # foo"""
 #         a = """raise Exception(5) # foo"""
 #         self.check(b, a)
-# 
+#
 #         b = """raise E, (5, 6) % (a, b) # foo"""
 #         a = """raise E((5, 6) % (a, b)) # foo"""
 #         self.check(b, a)
-# 
+#
 #         b = """def foo():
 #                     raise Exception, 5, 6 # foo"""
 #         a = """def foo():
 #                     raise Exception(5).with_traceback(6) # foo"""
 #         self.check(b, a)
-# 
+#
 #     def test_None_value(self):
 #         b = """raise Exception(5), None, tb"""
 #         a = """raise Exception(5).with_traceback(tb)"""
 #         self.check(b, a)
-# 
+#
 #     def test_tuple_value(self):
 #         b = """raise Exception, (5, 6, 7)"""
 #         a = """raise Exception(5, 6, 7)"""
 #         self.check(b, a)
-# 
+#
 #     def test_tuple_detection(self):
 #         b = """raise E, (5, 6) % (a, b)"""
 #         a = """raise E((5, 6) % (a, b))"""
 #         self.check(b, a)
-# 
+#
 #     def test_tuple_exc_1(self):
 #         b = """raise (((E1, E2), E3), E4), V"""
 #         a = """raise E1(V)"""
 #         self.check(b, a)
-# 
+#
 #     def test_tuple_exc_2(self):
 #         b = """raise (E1, (E2, E3), E4), V"""
 #         a = """raise E1(V)"""
 #         self.check(b, a)
-# 
+#
 #     # These should produce a warning
-# 
+#
 #     def test_string_exc(self):
 #         s = """raise 'foo'"""
 #         self.warns_unchanged(s, "Python 3 does not support string exceptions")
-# 
+#
 #     def test_string_exc_val(self):
 #         s = """raise "foo", 5"""
 #         self.warns_unchanged(s, "Python 3 does not support string exceptions")
-# 
+#
 #     def test_string_exc_val_tb(self):
 #         s = """raise "foo", 5, 6"""
 #         self.warns_unchanged(s, "Python 3 does not support string exceptions")
-# 
+#
 #     # These should result in traceback-assignment
-# 
+#
 #     def test_tb_1(self):
 #         b = """def foo():
 #                     raise Exception, 5, 6"""
 #         a = """def foo():
 #                     raise Exception(5).with_traceback(6)"""
 #         self.check(b, a)
-# 
+#
 #     def test_tb_2(self):
 #         b = """def foo():
 #                     a = 5
@@ -793,14 +793,14 @@ class Test_print(FixerTestCase):
 #                     raise Exception(5).with_traceback(6)
 #                     b = 6"""
 #         self.check(b, a)
-# 
+#
 #     def test_tb_3(self):
 #         b = """def foo():
 #                     raise Exception,5,6"""
 #         a = """def foo():
 #                     raise Exception(5).with_traceback(6)"""
 #         self.check(b, a)
-# 
+#
 #     def test_tb_4(self):
 #         b = """def foo():
 #                     a = 5
@@ -811,14 +811,14 @@ class Test_print(FixerTestCase):
 #                     raise Exception(5).with_traceback(6)
 #                     b = 6"""
 #         self.check(b, a)
-# 
+#
 #     def test_tb_5(self):
 #         b = """def foo():
 #                     raise Exception, (5, 6, 7), 6"""
 #         a = """def foo():
 #                     raise Exception(5, 6, 7).with_traceback(6)"""
 #         self.check(b, a)
-# 
+#
 #     def test_tb_6(self):
 #         b = """def foo():
 #                     a = 5
@@ -829,67 +829,67 @@ class Test_print(FixerTestCase):
 #                     raise Exception(5, 6, 7).with_traceback(6)
 #                     b = 6"""
 #         self.check(b, a)
-# 
+#
 # class Test_throw(FixerTestCase):
 #     fixer = "throw"
-# 
+#
 #     def test_1(self):
 #         b = """g.throw(Exception, 5)"""
 #         a = """g.throw(Exception(5))"""
 #         self.check(b, a)
-# 
+#
 #     def test_2(self):
 #         b = """g.throw(Exception,5)"""
 #         a = """g.throw(Exception(5))"""
 #         self.check(b, a)
-# 
+#
 #     def test_3(self):
 #         b = """g.throw(Exception, (5, 6, 7))"""
 #         a = """g.throw(Exception(5, 6, 7))"""
 #         self.check(b, a)
-# 
+#
 #     def test_4(self):
 #         b = """5 + g.throw(Exception, 5)"""
 #         a = """5 + g.throw(Exception(5))"""
 #         self.check(b, a)
-# 
+#
 #     # These should produce warnings
-# 
+#
 #     def test_warn_1(self):
 #         s = """g.throw("foo")"""
 #         self.warns_unchanged(s, "Python 3 does not support string exceptions")
-# 
+#
 #     def test_warn_2(self):
 #         s = """g.throw("foo", 5)"""
 #         self.warns_unchanged(s, "Python 3 does not support string exceptions")
-# 
+#
 #     def test_warn_3(self):
 #         s = """g.throw("foo", 5, 6)"""
 #         self.warns_unchanged(s, "Python 3 does not support string exceptions")
-# 
+#
 #     # These should not be touched
-# 
+#
 #     def test_untouched_1(self):
 #         s = """g.throw(Exception)"""
 #         self.unchanged(s)
-# 
+#
 #     def test_untouched_2(self):
 #         s = """g.throw(Exception(5, 6))"""
 #         self.unchanged(s)
-# 
+#
 #     def test_untouched_3(self):
 #         s = """5 + g.throw(Exception(5, 6))"""
 #         self.unchanged(s)
-# 
+#
 #     # These should result in traceback-assignment
-# 
+#
 #     def test_tb_1(self):
 #         b = """def foo():
 #                     g.throw(Exception, 5, 6)"""
 #         a = """def foo():
 #                     g.throw(Exception(5).with_traceback(6))"""
 #         self.check(b, a)
-# 
+#
 #     def test_tb_2(self):
 #         b = """def foo():
 #                     a = 5
@@ -900,14 +900,14 @@ class Test_print(FixerTestCase):
 #                     g.throw(Exception(5).with_traceback(6))
 #                     b = 6"""
 #         self.check(b, a)
-# 
+#
 #     def test_tb_3(self):
 #         b = """def foo():
 #                     g.throw(Exception,5,6)"""
 #         a = """def foo():
 #                     g.throw(Exception(5).with_traceback(6))"""
 #         self.check(b, a)
-# 
+#
 #     def test_tb_4(self):
 #         b = """def foo():
 #                     a = 5
@@ -918,14 +918,14 @@ class Test_print(FixerTestCase):
 #                     g.throw(Exception(5).with_traceback(6))
 #                     b = 6"""
 #         self.check(b, a)
-# 
+#
 #     def test_tb_5(self):
 #         b = """def foo():
 #                     g.throw(Exception, (5, 6, 7), 6)"""
 #         a = """def foo():
 #                     g.throw(Exception(5, 6, 7).with_traceback(6))"""
 #         self.check(b, a)
-# 
+#
 #     def test_tb_6(self):
 #         b = """def foo():
 #                     a = 5
@@ -936,14 +936,14 @@ class Test_print(FixerTestCase):
 #                     g.throw(Exception(5, 6, 7).with_traceback(6))
 #                     b = 6"""
 #         self.check(b, a)
-# 
+#
 #     def test_tb_7(self):
 #         b = """def foo():
 #                     a + g.throw(Exception, 5, 6)"""
 #         a = """def foo():
 #                     a + g.throw(Exception(5).with_traceback(6))"""
 #         self.check(b, a)
-# 
+#
 #     def test_tb_8(self):
 #         b = """def foo():
 #                     a = 5
@@ -954,596 +954,596 @@ class Test_print(FixerTestCase):
 #                     a + g.throw(Exception(5).with_traceback(6))
 #                     b = 6"""
 #         self.check(b, a)
-# 
+#
 # class Test_long(FixerTestCase):
 #     fixer = "long"
-# 
+#
 #     def test_1(self):
 #         b = """x = long(x)"""
 #         a = """x = int(x)"""
 #         self.check(b, a)
-# 
+#
 #     def test_2(self):
 #         b = """y = isinstance(x, long)"""
 #         a = """y = isinstance(x, int)"""
 #         self.check(b, a)
-# 
+#
 #     def test_3(self):
 #         b = """z = type(x) in (int, long)"""
 #         a = """z = type(x) in (int, int)"""
 #         self.check(b, a)
-# 
+#
 #     def test_unchanged(self):
 #         s = """long = True"""
 #         self.unchanged(s)
-# 
+#
 #         s = """s.long = True"""
 #         self.unchanged(s)
-# 
+#
 #         s = """def long(): pass"""
 #         self.unchanged(s)
-# 
+#
 #         s = """class long(): pass"""
 #         self.unchanged(s)
-# 
+#
 #         s = """def f(long): pass"""
 #         self.unchanged(s)
-# 
+#
 #         s = """def f(g, long): pass"""
 #         self.unchanged(s)
-# 
+#
 #         s = """def f(x, long=True): pass"""
 #         self.unchanged(s)
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = """x =   long(  x  )"""
 #         a = """x =   int(  x  )"""
 #         self.check(b, a)
-# 
-# 
+#
+#
 # class Test_execfile(FixerTestCase):
 #     fixer = "execfile"
-# 
+#
 #     def test_conversion(self):
 #         b = """execfile("fn")"""
 #         a = """exec(compile(open("fn").read(), "fn", 'exec'))"""
 #         self.check(b, a)
-# 
+#
 #         b = """execfile("fn", glob)"""
 #         a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)"""
 #         self.check(b, a)
-# 
+#
 #         b = """execfile("fn", glob, loc)"""
 #         a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)"""
 #         self.check(b, a)
-# 
+#
 #         b = """execfile("fn", globals=glob)"""
 #         a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)"""
 #         self.check(b, a)
-# 
+#
 #         b = """execfile("fn", locals=loc)"""
 #         a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)"""
 #         self.check(b, a)
-# 
+#
 #         b = """execfile("fn", globals=glob, locals=loc)"""
 #         a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)"""
 #         self.check(b, a)
-# 
+#
 #     def test_spacing(self):
 #         b = """execfile( "fn" )"""
 #         a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))"""
 #         self.check(b, a)
-# 
+#
 #         b = """execfile("fn",  globals = glob)"""
 #         a = """exec(compile(open("fn").read(), "fn", 'exec'),  globals = glob)"""
 #         self.check(b, a)
-# 
-# 
+#
+#
 # class Test_isinstance(FixerTestCase):
 #     fixer = "isinstance"
-# 
+#
 #     def test_remove_multiple_items(self):
 #         b = """isinstance(x, (int, int, int))"""
 #         a = """isinstance(x, int)"""
 #         self.check(b, a)
-# 
+#
 #         b = """isinstance(x, (int, float, int, int, float))"""
 #         a = """isinstance(x, (int, float))"""
 #         self.check(b, a)
-# 
+#
 #         b = """isinstance(x, (int, float, int, int, float, str))"""
 #         a = """isinstance(x, (int, float, str))"""
 #         self.check(b, a)
-# 
+#
 #         b = """isinstance(foo() + bar(), (x(), y(), x(), int, int))"""
 #         a = """isinstance(foo() + bar(), (x(), y(), x(), int))"""
 #         self.check(b, a)
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = """if    isinstance(  foo(), (  bar, bar, baz )) : pass"""
 #         a = """if    isinstance(  foo(), (  bar, baz )) : pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_unchanged(self):
 #         self.unchanged("isinstance(x, (str, int))")
-# 
+#
 # class Test_dict(FixerTestCase):
 #     fixer = "dict"
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = "if   d. keys  (  )  : pass"
 #         a = "if   list(d. keys  (  ))  : pass"
 #         self.check(b, a)
-# 
+#
 #         b = "if   d. items  (  )  : pass"
 #         a = "if   list(d. items  (  ))  : pass"
 #         self.check(b, a)
-# 
+#
 #         b = "if   d. iterkeys  ( )  : pass"
 #         a = "if   iter(d. keys  ( ))  : pass"
 #         self.check(b, a)
-# 
+#
 #         b = "[i for i in    d.  iterkeys(  )  ]"
 #         a = "[i for i in    d.  keys(  )  ]"
 #         self.check(b, a)
-# 
+#
 #         b = "if   d. viewkeys  ( )  : pass"
 #         a = "if   d. keys  ( )  : pass"
 #         self.check(b, a)
-# 
+#
 #         b = "[i for i in    d.  viewkeys(  )  ]"
 #         a = "[i for i in    d.  keys(  )  ]"
 #         self.check(b, a)
-# 
+#
 #     def test_trailing_comment(self):
 #         b = "d.keys() # foo"
 #         a = "list(d.keys()) # foo"
 #         self.check(b, a)
-# 
+#
 #         b = "d.items()  # foo"
 #         a = "list(d.items())  # foo"
 #         self.check(b, a)
-# 
+#
 #         b = "d.iterkeys()  # foo"
 #         a = "iter(d.keys())  # foo"
 #         self.check(b, a)
-# 
+#
 #         b = """[i for i in d.iterkeys() # foo
 #                ]"""
 #         a = """[i for i in d.keys() # foo
 #                ]"""
 #         self.check(b, a)
-# 
+#
 #         b = """[i for i in d.iterkeys() # foo
 #                ]"""
 #         a = """[i for i in d.keys() # foo
 #                ]"""
 #         self.check(b, a)
-# 
+#
 #         b = "d.viewitems()  # foo"
 #         a = "d.items()  # foo"
 #         self.check(b, a)
-# 
+#
 #     def test_unchanged(self):
 #         for wrapper in fixer_util.consuming_calls:
 #             s = "s = %s(d.keys())" % wrapper
 #             self.unchanged(s)
-# 
+#
 #             s = "s = %s(d.values())" % wrapper
 #             self.unchanged(s)
-# 
+#
 #             s = "s = %s(d.items())" % wrapper
 #             self.unchanged(s)
-# 
+#
 #     def test_01(self):
 #         b = "d.keys()"
 #         a = "list(d.keys())"
 #         self.check(b, a)
-# 
+#
 #         b = "a[0].foo().keys()"
 #         a = "list(a[0].foo().keys())"
 #         self.check(b, a)
-# 
+#
 #     def test_02(self):
 #         b = "d.items()"
 #         a = "list(d.items())"
 #         self.check(b, a)
-# 
+#
 #     def test_03(self):
 #         b = "d.values()"
 #         a = "list(d.values())"
 #         self.check(b, a)
-# 
+#
 #     def test_04(self):
 #         b = "d.iterkeys()"
 #         a = "iter(d.keys())"
 #         self.check(b, a)
-# 
+#
 #     def test_05(self):
 #         b = "d.iteritems()"
 #         a = "iter(d.items())"
 #         self.check(b, a)
-# 
+#
 #     def test_06(self):
 #         b = "d.itervalues()"
 #         a = "iter(d.values())"
 #         self.check(b, a)
-# 
+#
 #     def test_07(self):
 #         s = "list(d.keys())"
 #         self.unchanged(s)
-# 
+#
 #     def test_08(self):
 #         s = "sorted(d.keys())"
 #         self.unchanged(s)
-# 
+#
 #     def test_09(self):
 #         b = "iter(d.keys())"
 #         a = "iter(list(d.keys()))"
 #         self.check(b, a)
-# 
+#
 #     def test_10(self):
 #         b = "foo(d.keys())"
 #         a = "foo(list(d.keys()))"
 #         self.check(b, a)
-# 
+#
 #     def test_11(self):
 #         b = "for i in d.keys(): print i"
 #         a = "for i in list(d.keys()): print i"
 #         self.check(b, a)
-# 
+#
 #     def test_12(self):
 #         b = "for i in d.iterkeys(): print i"
 #         a = "for i in d.keys(): print i"
 #         self.check(b, a)
-# 
+#
 #     def test_13(self):
 #         b = "[i for i in d.keys()]"
 #         a = "[i for i in list(d.keys())]"
 #         self.check(b, a)
-# 
+#
 #     def test_14(self):
 #         b = "[i for i in d.iterkeys()]"
 #         a = "[i for i in d.keys()]"
 #         self.check(b, a)
-# 
+#
 #     def test_15(self):
 #         b = "(i for i in d.keys())"
 #         a = "(i for i in list(d.keys()))"
 #         self.check(b, a)
-# 
+#
 #     def test_16(self):
 #         b = "(i for i in d.iterkeys())"
 #         a = "(i for i in d.keys())"
 #         self.check(b, a)
-# 
+#
 #     def test_17(self):
 #         b = "iter(d.iterkeys())"
 #         a = "iter(d.keys())"
 #         self.check(b, a)
-# 
+#
 #     def test_18(self):
 #         b = "list(d.iterkeys())"
 #         a = "list(d.keys())"
 #         self.check(b, a)
-# 
+#
 #     def test_19(self):
 #         b = "sorted(d.iterkeys())"
 #         a = "sorted(d.keys())"
 #         self.check(b, a)
-# 
+#
 #     def test_20(self):
 #         b = "foo(d.iterkeys())"
 #         a = "foo(iter(d.keys()))"
 #         self.check(b, a)
-# 
+#
 #     def test_21(self):
 #         b = "print h.iterkeys().next()"
 #         a = "print iter(h.keys()).next()"
 #         self.check(b, a)
-# 
+#
 #     def test_22(self):
 #         b = "print h.keys()[0]"
 #         a = "print list(h.keys())[0]"
 #         self.check(b, a)
-# 
+#
 #     def test_23(self):
 #         b = "print list(h.iterkeys().next())"
 #         a = "print list(iter(h.keys()).next())"
 #         self.check(b, a)
-# 
+#
 #     def test_24(self):
 #         b = "for x in h.keys()[0]: print x"
 #         a = "for x in list(h.keys())[0]: print x"
 #         self.check(b, a)
-# 
+#
 #     def test_25(self):
 #         b = "d.viewkeys()"
 #         a = "d.keys()"
 #         self.check(b, a)
-# 
+#
 #     def test_26(self):
 #         b = "d.viewitems()"
 #         a = "d.items()"
 #         self.check(b, a)
-# 
+#
 #     def test_27(self):
 #         b = "d.viewvalues()"
 #         a = "d.values()"
 #         self.check(b, a)
-# 
+#
 #     def test_14(self):
 #         b = "[i for i in d.viewkeys()]"
 #         a = "[i for i in d.keys()]"
 #         self.check(b, a)
-# 
+#
 #     def test_15(self):
 #         b = "(i for i in d.viewkeys())"
 #         a = "(i for i in d.keys())"
 #         self.check(b, a)
-# 
+#
 #     def test_17(self):
 #         b = "iter(d.viewkeys())"
 #         a = "iter(d.keys())"
 #         self.check(b, a)
-# 
+#
 #     def test_18(self):
 #         b = "list(d.viewkeys())"
 #         a = "list(d.keys())"
 #         self.check(b, a)
-# 
+#
 #     def test_19(self):
 #         b = "sorted(d.viewkeys())"
 #         a = "sorted(d.keys())"
 #         self.check(b, a)
-# 
+#
 # class Test_xrange(FixerTestCase):
 #     fixer = "xrange"
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = """x =    xrange(  10  )"""
 #         a = """x =    range(  10  )"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = xrange(  1  ,  10   )"""
 #         a = """x = range(  1  ,  10   )"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = xrange(  0  ,  10 ,  2 )"""
 #         a = """x = range(  0  ,  10 ,  2 )"""
 #         self.check(b, a)
-# 
+#
 #     def test_single_arg(self):
 #         b = """x = xrange(10)"""
 #         a = """x = range(10)"""
 #         self.check(b, a)
-# 
+#
 #     def test_two_args(self):
 #         b = """x = xrange(1, 10)"""
 #         a = """x = range(1, 10)"""
 #         self.check(b, a)
-# 
+#
 #     def test_three_args(self):
 #         b = """x = xrange(0, 10, 2)"""
 #         a = """x = range(0, 10, 2)"""
 #         self.check(b, a)
-# 
+#
 #     def test_wrap_in_list(self):
 #         b = """x = range(10, 3, 9)"""
 #         a = """x = list(range(10, 3, 9))"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = foo(range(10, 3, 9))"""
 #         a = """x = foo(list(range(10, 3, 9)))"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = range(10, 3, 9) + [4]"""
 #         a = """x = list(range(10, 3, 9)) + [4]"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = range(10)[::-1]"""
 #         a = """x = list(range(10))[::-1]"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = range(10)  [3]"""
 #         a = """x = list(range(10))  [3]"""
 #         self.check(b, a)
-# 
+#
 #     def test_xrange_in_for(self):
 #         b = """for i in xrange(10):\n    j=i"""
 #         a = """for i in range(10):\n    j=i"""
 #         self.check(b, a)
-# 
+#
 #         b = """[i for i in xrange(10)]"""
 #         a = """[i for i in range(10)]"""
 #         self.check(b, a)
-# 
+#
 #     def test_range_in_for(self):
 #         self.unchanged("for i in range(10): pass")
 #         self.unchanged("[i for i in range(10)]")
-# 
+#
 #     def test_in_contains_test(self):
 #         self.unchanged("x in range(10, 3, 9)")
-# 
+#
 #     def test_in_consuming_context(self):
 #         for call in fixer_util.consuming_calls:
 #             self.unchanged("a = %s(range(10))" % call)
-# 
+#
 # class Test_xrange_with_reduce(FixerTestCase):
-# 
+#
 #     def setUp(self):
 #         super(Test_xrange_with_reduce, self).setUp(["xrange", "reduce"])
-# 
+#
 #     def test_double_transform(self):
 #         b = """reduce(x, xrange(5))"""
 #         a = """from functools import reduce
 # reduce(x, range(5))"""
 #         self.check(b, a)
-# 
+#
 # class Test_raw_input(FixerTestCase):
 #     fixer = "raw_input"
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = """x =    raw_input(   )"""
 #         a = """x =    input(   )"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = raw_input(   ''   )"""
 #         a = """x = input(   ''   )"""
 #         self.check(b, a)
-# 
+#
 #     def test_1(self):
 #         b = """x = raw_input()"""
 #         a = """x = input()"""
 #         self.check(b, a)
-# 
+#
 #     def test_2(self):
 #         b = """x = raw_input('')"""
 #         a = """x = input('')"""
 #         self.check(b, a)
-# 
+#
 #     def test_3(self):
 #         b = """x = raw_input('prompt')"""
 #         a = """x = input('prompt')"""
 #         self.check(b, a)
-# 
+#
 #     def test_4(self):
 #         b = """x = raw_input(foo(a) + 6)"""
 #         a = """x = input(foo(a) + 6)"""
 #         self.check(b, a)
-# 
+#
 #     def test_5(self):
 #         b = """x = raw_input(invite).split()"""
 #         a = """x = input(invite).split()"""
 #         self.check(b, a)
-# 
+#
 #     def test_6(self):
 #         b = """x = raw_input(invite) . split ()"""
 #         a = """x = input(invite) . split ()"""
 #         self.check(b, a)
-# 
+#
 #     def test_8(self):
 #         b = "x = int(raw_input())"
 #         a = "x = int(input())"
 #         self.check(b, a)
-# 
+#
 # class Test_funcattrs(FixerTestCase):
 #     fixer = "funcattrs"
-# 
+#
 #     attrs = ["closure", "doc", "name", "defaults", "code", "globals", "dict"]
-# 
+#
 #     def test(self):
 #         for attr in self.attrs:
 #             b = "a.func_%s" % attr
 #             a = "a.__%s__" % attr
 #             self.check(b, a)
-# 
+#
 #             b = "self.foo.func_%s.foo_bar" % attr
 #             a = "self.foo.__%s__.foo_bar" % attr
 #             self.check(b, a)
-# 
+#
 #     def test_unchanged(self):
 #         for attr in self.attrs:
 #             s = "foo(func_%s + 5)" % attr
 #             self.unchanged(s)
-# 
+#
 #             s = "f(foo.__%s__)" % attr
 #             self.unchanged(s)
-# 
+#
 #             s = "f(foo.__%s__.foo)" % attr
 #             self.unchanged(s)
-# 
+#
 # class Test_xreadlines(FixerTestCase):
 #     fixer = "xreadlines"
-# 
+#
 #     def test_call(self):
 #         b = "for x in f.xreadlines(): pass"
 #         a = "for x in f: pass"
 #         self.check(b, a)
-# 
+#
 #         b = "for x in foo().xreadlines(): pass"
 #         a = "for x in foo(): pass"
 #         self.check(b, a)
-# 
+#
 #         b = "for x in (5 + foo()).xreadlines(): pass"
 #         a = "for x in (5 + foo()): pass"
 #         self.check(b, a)
-# 
+#
 #     def test_attr_ref(self):
 #         b = "foo(f.xreadlines + 5)"
 #         a = "foo(f.__iter__ + 5)"
 #         self.check(b, a)
-# 
+#
 #         b = "foo(f().xreadlines + 5)"
 #         a = "foo(f().__iter__ + 5)"
 #         self.check(b, a)
-# 
+#
 #         b = "foo((5 + f()).xreadlines + 5)"
 #         a = "foo((5 + f()).__iter__ + 5)"
 #         self.check(b, a)
-# 
+#
 #     def test_unchanged(self):
 #         s = "for x in f.xreadlines(5): pass"
 #         self.unchanged(s)
-# 
+#
 #         s = "for x in f.xreadlines(k=5): pass"
 #         self.unchanged(s)
-# 
+#
 #         s = "for x in f.xreadlines(*k, **v): pass"
 #         self.unchanged(s)
-# 
+#
 #         s = "foo(xreadlines)"
 #         self.unchanged(s)
-# 
-# 
+#
+#
 # class ImportsFixerTests:
-# 
+#
 #     def test_import_module(self):
 #         for old, new in self.modules.items():
 #             b = "import %s" % old
 #             a = "import %s" % new
 #             self.check(b, a)
-# 
+#
 #             b = "import foo, %s, bar" % old
 #             a = "import foo, %s, bar" % new
 #             self.check(b, a)
-# 
+#
 #     def test_import_from(self):
 #         for old, new in self.modules.items():
 #             b = "from %s import foo" % old
 #             a = "from %s import foo" % new
 #             self.check(b, a)
-# 
+#
 #             b = "from %s import foo, bar" % old
 #             a = "from %s import foo, bar" % new
 #             self.check(b, a)
-# 
+#
 #             b = "from %s import (yes, no)" % old
 #             a = "from %s import (yes, no)" % new
 #             self.check(b, a)
-# 
+#
 #     def test_import_module_as(self):
 #         for old, new in self.modules.items():
 #             b = "import %s as foo_bar" % old
 #             a = "import %s as foo_bar" % new
 #             self.check(b, a)
-# 
+#
 #             b = "import %s as foo_bar" % old
 #             a = "import %s as foo_bar" % new
 #             self.check(b, a)
-# 
+#
 #     def test_import_from_as(self):
 #         for old, new in self.modules.items():
 #             b = "from %s import foo as bar" % old
 #             a = "from %s import foo as bar" % new
 #             self.check(b, a)
-# 
+#
 #     def test_star(self):
 #         for old, new in self.modules.items():
 #             b = "from %s import *" % old
 #             a = "from %s import *" % new
 #             self.check(b, a)
-# 
+#
 #     def test_import_module_usage(self):
 #         for old, new in self.modules.items():
 #             b = """
@@ -1555,7 +1555,7 @@ class Test_print(FixerTestCase):
 #                 foo(%s.bar)
 #                 """ % (new, new)
 #             self.check(b, a)
-# 
+#
 #             b = """
 #                 from %s import x
 #                 %s = 23
@@ -1565,13 +1565,13 @@ class Test_print(FixerTestCase):
 #                 %s = 23
 #                 """ % (new, old)
 #             self.check(b, a)
-# 
+#
 #             s = """
 #                 def f():
 #                     %s.method()
 #                 """ % (old,)
 #             self.unchanged(s)
-# 
+#
 #             # test nested usage
 #             b = """
 #                 import %s
@@ -1582,7 +1582,7 @@ class Test_print(FixerTestCase):
 #                 %s.bar(%s.foo)
 #                 """ % (new, new, new)
 #             self.check(b, a)
-# 
+#
 #             b = """
 #                 import %s
 #                 x.%s
@@ -1592,16 +1592,16 @@ class Test_print(FixerTestCase):
 #                 x.%s
 #                 """ % (new, old)
 #             self.check(b, a)
-# 
-# 
+#
+#
 # class Test_imports(FixerTestCase, ImportsFixerTests):
 #     fixer = "imports"
-# 
+#
 #     def test_multiple_imports(self):
 #         b = """import urlparse, cStringIO"""
 #         a = """import urllib.parse, io"""
 #         self.check(b, a)
-# 
+#
 #     def test_multiple_imports_as(self):
 #         b = """
 #             import copy_reg as bar, HTMLParser as foo, urlparse
@@ -1612,14 +1612,14 @@ class Test_print(FixerTestCase):
 #             s = urllib.parse.spam(bar.foo())
 #             """
 #         self.check(b, a)
-# 
-# 
+#
+#
 # class Test_imports2(FixerTestCase, ImportsFixerTests):
 #     fixer = "imports2"
-# 
-# 
+#
+#
 # class Test_imports_fixer_order(FixerTestCase, ImportsFixerTests):
-# 
+#
 #     def setUp(self):
 #         super(Test_imports_fixer_order, self).setUp(['imports', 'imports2'])
 #         from ..fixes.fix_imports2 import MAPPING as mapping2
@@ -1627,23 +1627,23 @@ class Test_print(FixerTestCase):
 #         from ..fixes.fix_imports import MAPPING as mapping1
 #         for key in ('dbhash', 'dumbdbm', 'dbm', 'gdbm'):
 #             self.modules[key] = mapping1[key]
-# 
+#
 #     def test_after_local_imports_refactoring(self):
 #         for fix in ("imports", "imports2"):
 #             self.fixer = fix
 #             self.assert_runs_after("import")
-# 
-# 
+#
+#
 # class Test_urllib(FixerTestCase):
 #     fixer = "urllib"
 #     from ..fixes.fix_urllib import MAPPING as modules
-# 
+#
 #     def test_import_module(self):
 #         for old, changes in self.modules.items():
 #             b = "import %s" % old
 #             a = "import %s" % ", ".join(map(itemgetter(0), changes))
 #             self.check(b, a)
-# 
+#
 #     def test_import_from(self):
 #         for old, changes in self.modules.items():
 #             all_members = []
@@ -1653,28 +1653,28 @@ class Test_print(FixerTestCase):
 #                     b = "from %s import %s" % (old, member)
 #                     a = "from %s import %s" % (new, member)
 #                     self.check(b, a)
-# 
+#
 #                     s = "from foo import %s" % member
 #                     self.unchanged(s)
-# 
+#
 #                 b = "from %s import %s" % (old, ", ".join(members))
 #                 a = "from %s import %s" % (new, ", ".join(members))
 #                 self.check(b, a)
-# 
+#
 #                 s = "from foo import %s" % ", ".join(members)
 #                 self.unchanged(s)
-# 
+#
 #             # test the breaking of a module into multiple replacements
 #             b = "from %s import %s" % (old, ", ".join(all_members))
 #             a = "\n".join(["from %s import %s" % (new, ", ".join(members))
 #                             for (new, members) in changes])
 #             self.check(b, a)
-# 
+#
 #     def test_import_module_as(self):
 #         for old in self.modules:
 #             s = "import %s as foo" % old
 #             self.warns_unchanged(s, "This module is now multiple modules")
-# 
+#
 #     def test_import_from_as(self):
 #         for old, changes in self.modules.items():
 #             for new, members in changes:
@@ -1685,12 +1685,12 @@ class Test_print(FixerTestCase):
 #                     b = "from %s import %s as blah, %s" % (old, member, member)
 #                     a = "from %s import %s as blah, %s" % (new, member, member)
 #                     self.check(b, a)
-# 
+#
 #     def test_star(self):
 #         for old in self.modules:
 #             s = "from %s import *" % old
 #             self.warns_unchanged(s, "Cannot handle star imports")
-# 
+#
 #     def test_indented(self):
 #         b = """
 # def foo():
@@ -1702,7 +1702,7 @@ class Test_print(FixerTestCase):
 #     from urllib.request import urlopen
 # """
 #         self.check(b, a)
-# 
+#
 #         b = """
 # def foo():
 #     other()
@@ -1715,9 +1715,9 @@ class Test_print(FixerTestCase):
 #     from urllib.request import urlopen
 # """
 #         self.check(b, a)
-# 
-# 
-# 
+#
+#
+#
 #     def test_import_module_usage(self):
 #         for old, changes in self.modules.items():
 #             for new, members in changes:
@@ -1742,163 +1742,163 @@ class Test_print(FixerTestCase):
 #                         %s.%s(%s.%s)
 #                         """ % (new_import, new, member, new, member)
 #                     self.check(b, a)
-# 
-# 
+#
+#
 # class Test_input(FixerTestCase):
 #     fixer = "input"
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = """x =   input(   )"""
 #         a = """x =   eval(input(   ))"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = input(   ''   )"""
 #         a = """x = eval(input(   ''   ))"""
 #         self.check(b, a)
-# 
+#
 #     def test_trailing_comment(self):
 #         b = """x = input()  #  foo"""
 #         a = """x = eval(input())  #  foo"""
 #         self.check(b, a)
-# 
+#
 #     def test_idempotency(self):
 #         s = """x = eval(input())"""
 #         self.unchanged(s)
-# 
+#
 #         s = """x = eval(input(''))"""
 #         self.unchanged(s)
-# 
+#
 #         s = """x = eval(input(foo(5) + 9))"""
 #         self.unchanged(s)
-# 
+#
 #     def test_1(self):
 #         b = """x = input()"""
 #         a = """x = eval(input())"""
 #         self.check(b, a)
-# 
+#
 #     def test_2(self):
 #         b = """x = input('')"""
 #         a = """x = eval(input(''))"""
 #         self.check(b, a)
-# 
+#
 #     def test_3(self):
 #         b = """x = input('prompt')"""
 #         a = """x = eval(input('prompt'))"""
 #         self.check(b, a)
-# 
+#
 #     def test_4(self):
 #         b = """x = input(foo(5) + 9)"""
 #         a = """x = eval(input(foo(5) + 9))"""
 #         self.check(b, a)
-# 
+#
 # class Test_tuple_params(FixerTestCase):
 #     fixer = "tuple_params"
-# 
+#
 #     def test_unchanged_1(self):
 #         s = """def foo(): pass"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_2(self):
 #         s = """def foo(a, b, c): pass"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_3(self):
 #         s = """def foo(a=3, b=4, c=5): pass"""
 #         self.unchanged(s)
-# 
+#
 #     def test_1(self):
 #         b = """
 #             def foo(((a, b), c)):
 #                 x = 5"""
-# 
+#
 #         a = """
 #             def foo(xxx_todo_changeme):
 #                 ((a, b), c) = xxx_todo_changeme
 #                 x = 5"""
 #         self.check(b, a)
-# 
+#
 #     def test_2(self):
 #         b = """
 #             def foo(((a, b), c), d):
 #                 x = 5"""
-# 
+#
 #         a = """
 #             def foo(xxx_todo_changeme, d):
 #                 ((a, b), c) = xxx_todo_changeme
 #                 x = 5"""
 #         self.check(b, a)
-# 
+#
 #     def test_3(self):
 #         b = """
 #             def foo(((a, b), c), d) -> e:
 #                 x = 5"""
-# 
+#
 #         a = """
 #             def foo(xxx_todo_changeme, d) -> e:
 #                 ((a, b), c) = xxx_todo_changeme
 #                 x = 5"""
 #         self.check(b, a)
-# 
+#
 #     def test_semicolon(self):
 #         b = """
 #             def foo(((a, b), c)): x = 5; y = 7"""
-# 
+#
 #         a = """
 #             def foo(xxx_todo_changeme): ((a, b), c) = xxx_todo_changeme; x = 5; y = 7"""
 #         self.check(b, a)
-# 
+#
 #     def test_keywords(self):
 #         b = """
 #             def foo(((a, b), c), d, e=5) -> z:
 #                 x = 5"""
-# 
+#
 #         a = """
 #             def foo(xxx_todo_changeme, d, e=5) -> z:
 #                 ((a, b), c) = xxx_todo_changeme
 #                 x = 5"""
 #         self.check(b, a)
-# 
+#
 #     def test_varargs(self):
 #         b = """
 #             def foo(((a, b), c), d, *vargs, **kwargs) -> z:
 #                 x = 5"""
-# 
+#
 #         a = """
 #             def foo(xxx_todo_changeme, d, *vargs, **kwargs) -> z:
 #                 ((a, b), c) = xxx_todo_changeme
 #                 x = 5"""
 #         self.check(b, a)
-# 
+#
 #     def test_multi_1(self):
 #         b = """
 #             def foo(((a, b), c), (d, e, f)) -> z:
 #                 x = 5"""
-# 
+#
 #         a = """
 #             def foo(xxx_todo_changeme, xxx_todo_changeme1) -> z:
 #                 ((a, b), c) = xxx_todo_changeme
 #                 (d, e, f) = xxx_todo_changeme1
 #                 x = 5"""
 #         self.check(b, a)
-# 
+#
 #     def test_multi_2(self):
 #         b = """
 #             def foo(x, ((a, b), c), d, (e, f, g), y) -> z:
 #                 x = 5"""
-# 
+#
 #         a = """
 #             def foo(x, xxx_todo_changeme, d, xxx_todo_changeme1, y) -> z:
 #                 ((a, b), c) = xxx_todo_changeme
 #                 (e, f, g) = xxx_todo_changeme1
 #                 x = 5"""
 #         self.check(b, a)
-# 
+#
 #     def test_docstring(self):
 #         b = """
 #             def foo(((a, b), c), (d, e, f)) -> z:
 #                 "foo foo foo foo"
 #                 x = 5"""
-# 
+#
 #         a = """
 #             def foo(xxx_todo_changeme, xxx_todo_changeme1) -> z:
 #                 "foo foo foo foo"
@@ -1906,83 +1906,83 @@ class Test_print(FixerTestCase):
 #                 (d, e, f) = xxx_todo_changeme1
 #                 x = 5"""
 #         self.check(b, a)
-# 
+#
 #     def test_lambda_no_change(self):
 #         s = """lambda x: x + 5"""
 #         self.unchanged(s)
-# 
+#
 #     def test_lambda_parens_single_arg(self):
 #         b = """lambda (x): x + 5"""
 #         a = """lambda x: x + 5"""
 #         self.check(b, a)
-# 
+#
 #         b = """lambda(x): x + 5"""
 #         a = """lambda x: x + 5"""
 #         self.check(b, a)
-# 
+#
 #         b = """lambda ((((x)))): x + 5"""
 #         a = """lambda x: x + 5"""
 #         self.check(b, a)
-# 
+#
 #         b = """lambda((((x)))): x + 5"""
 #         a = """lambda x: x + 5"""
 #         self.check(b, a)
-# 
+#
 #     def test_lambda_simple(self):
 #         b = """lambda (x, y): x + f(y)"""
 #         a = """lambda x_y: x_y[0] + f(x_y[1])"""
 #         self.check(b, a)
-# 
+#
 #         b = """lambda(x, y): x + f(y)"""
 #         a = """lambda x_y: x_y[0] + f(x_y[1])"""
 #         self.check(b, a)
-# 
+#
 #         b = """lambda (((x, y))): x + f(y)"""
 #         a = """lambda x_y: x_y[0] + f(x_y[1])"""
 #         self.check(b, a)
-# 
+#
 #         b = """lambda(((x, y))): x + f(y)"""
 #         a = """lambda x_y: x_y[0] + f(x_y[1])"""
 #         self.check(b, a)
-# 
+#
 #     def test_lambda_one_tuple(self):
 #         b = """lambda (x,): x + f(x)"""
 #         a = """lambda x1: x1[0] + f(x1[0])"""
 #         self.check(b, a)
-# 
+#
 #         b = """lambda (((x,))): x + f(x)"""
 #         a = """lambda x1: x1[0] + f(x1[0])"""
 #         self.check(b, a)
-# 
+#
 #     def test_lambda_simple_multi_use(self):
 #         b = """lambda (x, y): x + x + f(x) + x"""
 #         a = """lambda x_y: x_y[0] + x_y[0] + f(x_y[0]) + x_y[0]"""
 #         self.check(b, a)
-# 
+#
 #     def test_lambda_simple_reverse(self):
 #         b = """lambda (x, y): y + x"""
 #         a = """lambda x_y: x_y[1] + x_y[0]"""
 #         self.check(b, a)
-# 
+#
 #     def test_lambda_nested(self):
 #         b = """lambda (x, (y, z)): x + y + z"""
 #         a = """lambda x_y_z: x_y_z[0] + x_y_z[1][0] + x_y_z[1][1]"""
 #         self.check(b, a)
-# 
+#
 #         b = """lambda (((x, (y, z)))): x + y + z"""
 #         a = """lambda x_y_z: x_y_z[0] + x_y_z[1][0] + x_y_z[1][1]"""
 #         self.check(b, a)
-# 
+#
 #     def test_lambda_nested_multi_use(self):
 #         b = """lambda (x, (y, z)): x + y + f(y)"""
 #         a = """lambda x_y_z: x_y_z[0] + x_y_z[1][0] + f(x_y_z[1][0])"""
 #         self.check(b, a)
-# 
+#
 # class Test_methodattrs(FixerTestCase):
 #     fixer = "methodattrs"
-# 
+#
 #     attrs = ["func", "self", "class"]
-# 
+#
 #     def test(self):
 #         for attr in self.attrs:
 #             b = "a.im_%s" % attr
@@ -1991,58 +1991,58 @@ class Test_print(FixerTestCase):
 #             else:
 #                 a = "a.__%s__" % attr
 #             self.check(b, a)
-# 
+#
 #             b = "self.foo.im_%s.foo_bar" % attr
 #             if attr == "class":
 #                 a = "self.foo.__self__.__class__.foo_bar"
 #             else:
 #                 a = "self.foo.__%s__.foo_bar" % attr
 #             self.check(b, a)
-# 
+#
 #     def test_unchanged(self):
 #         for attr in self.attrs:
 #             s = "foo(im_%s + 5)" % attr
 #             self.unchanged(s)
-# 
+#
 #             s = "f(foo.__%s__)" % attr
 #             self.unchanged(s)
-# 
+#
 #             s = "f(foo.__%s__.foo)" % attr
 #             self.unchanged(s)
-# 
+#
 # class Test_next(FixerTestCase):
 #     fixer = "next"
-# 
+#
 #     def test_1(self):
 #         b = """it.next()"""
 #         a = """next(it)"""
 #         self.check(b, a)
-# 
+#
 #     def test_2(self):
 #         b = """a.b.c.d.next()"""
 #         a = """next(a.b.c.d)"""
 #         self.check(b, a)
-# 
+#
 #     def test_3(self):
 #         b = """(a + b).next()"""
 #         a = """next((a + b))"""
 #         self.check(b, a)
-# 
+#
 #     def test_4(self):
 #         b = """a().next()"""
 #         a = """next(a())"""
 #         self.check(b, a)
-# 
+#
 #     def test_5(self):
 #         b = """a().next() + b"""
 #         a = """next(a()) + b"""
 #         self.check(b, a)
-# 
+#
 #     def test_6(self):
 #         b = """c(      a().next() + b)"""
 #         a = """c(      next(a()) + b)"""
 #         self.check(b, a)
-# 
+#
 #     def test_prefix_preservation_1(self):
 #         b = """
 #             for a in b:
@@ -2055,7 +2055,7 @@ class Test_print(FixerTestCase):
 #                 next(a)
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_prefix_preservation_2(self):
 #         b = """
 #             for a in b:
@@ -2070,7 +2070,7 @@ class Test_print(FixerTestCase):
 #                 next(a)
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_prefix_preservation_3(self):
 #         b = """
 #             next = 5
@@ -2085,7 +2085,7 @@ class Test_print(FixerTestCase):
 #                 a.__next__()
 #             """
 #         self.check(b, a, ignore_warnings=True)
-# 
+#
 #     def test_prefix_preservation_4(self):
 #         b = """
 #             next = 5
@@ -2102,7 +2102,7 @@ class Test_print(FixerTestCase):
 #                 a.__next__()
 #             """
 #         self.check(b, a, ignore_warnings=True)
-# 
+#
 #     def test_prefix_preservation_5(self):
 #         b = """
 #             next = 5
@@ -2117,7 +2117,7 @@ class Test_print(FixerTestCase):
 #                     a.__next__())
 #             """
 #         self.check(b, a, ignore_warnings=True)
-# 
+#
 #     def test_prefix_preservation_6(self):
 #         b = """
 #             for a in b:
@@ -2130,7 +2130,7 @@ class Test_print(FixerTestCase):
 #                     next(a))
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_method_1(self):
 #         b = """
 #             class A:
@@ -2143,7 +2143,7 @@ class Test_print(FixerTestCase):
 #                     pass
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_method_2(self):
 #         b = """
 #             class A(object):
@@ -2156,7 +2156,7 @@ class Test_print(FixerTestCase):
 #                     pass
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_method_3(self):
 #         b = """
 #             class A:
@@ -2169,16 +2169,16 @@ class Test_print(FixerTestCase):
 #                     pass
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_method_4(self):
 #         b = """
 #             class A:
 #                 def __init__(self, foo):
 #                     self.foo = foo
-# 
+#
 #                 def next(self):
 #                     pass
-# 
+#
 #                 def __iter__(self):
 #                     return self
 #             """
@@ -2186,15 +2186,15 @@ class Test_print(FixerTestCase):
 #             class A:
 #                 def __init__(self, foo):
 #                     self.foo = foo
-# 
+#
 #                 def __next__(self):
 #                     pass
-# 
+#
 #                 def __iter__(self):
 #                     return self
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_method_unchanged(self):
 #         s = """
 #             class A:
@@ -2202,227 +2202,227 @@ class Test_print(FixerTestCase):
 #                     pass
 #             """
 #         self.unchanged(s)
-# 
+#
 #     def test_shadowing_assign_simple(self):
 #         s = """
 #             next = foo
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_assign_tuple_1(self):
 #         s = """
 #             (next, a) = foo
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_assign_tuple_2(self):
 #         s = """
 #             (a, (b, (next, c)), a) = foo
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_assign_list_1(self):
 #         s = """
 #             [next, a] = foo
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_assign_list_2(self):
 #         s = """
 #             [a, [b, [next, c]], a] = foo
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_builtin_assign(self):
 #         s = """
 #             def foo():
 #                 __builtin__.next = foo
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_builtin_assign_in_tuple(self):
 #         s = """
 #             def foo():
 #                 (a, __builtin__.next) = foo
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_builtin_assign_in_list(self):
 #         s = """
 #             def foo():
 #                 [a, __builtin__.next] = foo
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_assign_to_next(self):
 #         s = """
 #             def foo():
 #                 A.next = foo
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.unchanged(s)
-# 
+#
 #     def test_assign_to_next_in_tuple(self):
 #         s = """
 #             def foo():
 #                 (a, A.next) = foo
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.unchanged(s)
-# 
+#
 #     def test_assign_to_next_in_list(self):
 #         s = """
 #             def foo():
 #                 [a, A.next] = foo
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.unchanged(s)
-# 
+#
 #     def test_shadowing_import_1(self):
 #         s = """
 #             import foo.bar as next
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_import_2(self):
 #         s = """
 #             import bar, bar.foo as next
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_import_3(self):
 #         s = """
 #             import bar, bar.foo as next, baz
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_import_from_1(self):
 #         s = """
 #             from x import next
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_import_from_2(self):
 #         s = """
 #             from x.a import next
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_import_from_3(self):
 #         s = """
 #             from x import a, next, b
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_import_from_4(self):
 #         s = """
 #             from x.a import a, next, b
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_funcdef_1(self):
 #         s = """
 #             def next(a):
 #                 pass
-# 
+#
 #             class A:
 #                 def next(self, a, b):
 #                     pass
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_funcdef_2(self):
 #         b = """
 #             def next(a):
 #                 pass
-# 
+#
 #             class A:
 #                 def next(self):
 #                     pass
-# 
+#
 #             it.next()
 #             """
 #         a = """
 #             def next(a):
 #                 pass
-# 
+#
 #             class A:
 #                 def __next__(self):
 #                     pass
-# 
+#
 #             it.__next__()
 #             """
 #         self.warns(b, a, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_global_1(self):
 #         s = """
 #             def f():
@@ -2430,7 +2430,7 @@ class Test_print(FixerTestCase):
 #                 next = 5
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_global_2(self):
 #         s = """
 #             def f():
@@ -2438,55 +2438,55 @@ class Test_print(FixerTestCase):
 #                 next = 5
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_for_simple(self):
 #         s = """
 #             for next in it():
 #                 pass
-# 
+#
 #             b = 5
 #             c = 6
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_for_tuple_1(self):
 #         s = """
 #             for next, b in it():
 #                 pass
-# 
+#
 #             b = 5
 #             c = 6
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_shadowing_for_tuple_2(self):
 #         s = """
 #             for a, (next, c), b in it():
 #                 pass
-# 
+#
 #             b = 5
 #             c = 6
 #             """
 #         self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
-# 
+#
 #     def test_noncall_access_1(self):
 #         b = """gnext = g.next"""
 #         a = """gnext = g.__next__"""
 #         self.check(b, a)
-# 
+#
 #     def test_noncall_access_2(self):
 #         b = """f(g.next + 5)"""
 #         a = """f(g.__next__ + 5)"""
 #         self.check(b, a)
-# 
+#
 #     def test_noncall_access_3(self):
 #         b = """f(g().next + 5)"""
 #         a = """f(g().__next__ + 5)"""
 #         self.check(b, a)
-# 
+#
 # class Test_nonzero(FixerTestCase):
 #     fixer = "nonzero"
-# 
+#
 #     def test_1(self):
 #         b = """
 #             class A:
@@ -2499,7 +2499,7 @@ class Test_print(FixerTestCase):
 #                     pass
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_2(self):
 #         b = """
 #             class A(object):
@@ -2512,7 +2512,7 @@ class Test_print(FixerTestCase):
 #                     pass
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_unchanged_1(self):
 #         s = """
 #             class A(object):
@@ -2520,7 +2520,7 @@ class Test_print(FixerTestCase):
 #                     pass
 #             """
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_2(self):
 #         s = """
 #             class A(object):
@@ -2528,101 +2528,101 @@ class Test_print(FixerTestCase):
 #                     pass
 #             """
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_func(self):
 #         s = """
 #             def __nonzero__(self):
 #                 pass
 #             """
 #         self.unchanged(s)
-# 
+#
 # class Test_numliterals(FixerTestCase):
 #     fixer = "numliterals"
-# 
+#
 #     def test_octal_1(self):
 #         b = """0755"""
 #         a = """0o755"""
 #         self.check(b, a)
-# 
+#
 #     def test_long_int_1(self):
 #         b = """a = 12L"""
 #         a = """a = 12"""
 #         self.check(b, a)
-# 
+#
 #     def test_long_int_2(self):
 #         b = """a = 12l"""
 #         a = """a = 12"""
 #         self.check(b, a)
-# 
+#
 #     def test_long_hex(self):
 #         b = """b = 0x12l"""
 #         a = """b = 0x12"""
 #         self.check(b, a)
-# 
+#
 #     def test_comments_and_spacing(self):
 #         b = """b =   0x12L"""
 #         a = """b =   0x12"""
 #         self.check(b, a)
-# 
+#
 #         b = """b = 0755 # spam"""
 #         a = """b = 0o755 # spam"""
 #         self.check(b, a)
-# 
+#
 #     def test_unchanged_int(self):
 #         s = """5"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_float(self):
 #         s = """5.0"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_octal(self):
 #         s = """0o755"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_hex(self):
 #         s = """0xABC"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_exp(self):
 #         s = """5.0e10"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_complex_int(self):
 #         s = """5 + 4j"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_complex_float(self):
 #         s = """5.4 + 4.9j"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_complex_bare(self):
 #         s = """4j"""
 #         self.unchanged(s)
 #         s = """4.4j"""
 #         self.unchanged(s)
-# 
+#
 # class Test_renames(FixerTestCase):
 #     fixer = "renames"
-# 
+#
 #     modules = {"sys":  ("maxint", "maxsize"),
 #               }
-# 
+#
 #     def test_import_from(self):
 #         for mod, (old, new) in self.modules.items():
 #             b = "from %s import %s" % (mod, old)
 #             a = "from %s import %s" % (mod, new)
 #             self.check(b, a)
-# 
+#
 #             s = "from foo import %s" % old
 #             self.unchanged(s)
-# 
+#
 #     def test_import_from_as(self):
 #         for mod, (old, new) in self.modules.items():
 #             b = "from %s import %s as foo_bar" % (mod, old)
 #             a = "from %s import %s as foo_bar" % (mod, new)
 #             self.check(b, a)
-# 
+#
 #     def test_import_module_usage(self):
 #         for mod, (old, new) in self.modules.items():
 #             b = """
@@ -2634,7 +2634,7 @@ class Test_print(FixerTestCase):
 #                 foo(%s, %s.%s)
 #                 """ % (mod, mod, mod, new)
 #             self.check(b, a)
-# 
+#
 #     def XXX_test_from_import_usage(self):
 #         # not implemented yet
 #         for mod, (old, new) in self.modules.items():
@@ -2647,66 +2647,66 @@ class Test_print(FixerTestCase):
 #                 foo(%s, %s)
 #                 """ % (mod, new, mod, new)
 #             self.check(b, a)
-# 
+#
 # class Test_unicode(FixerTestCase):
 #     fixer = "unicode"
-# 
+#
 #     def test_whitespace(self):
 #         b = """unicode( x)"""
 #         a = """str( x)"""
 #         self.check(b, a)
-# 
+#
 #         b = """ unicode(x )"""
 #         a = """ str(x )"""
 #         self.check(b, a)
-# 
+#
 #         b = """ u'h'"""
 #         a = """ 'h'"""
 #         self.check(b, a)
-# 
+#
 #     def test_unicode_call(self):
 #         b = """unicode(x, y, z)"""
 #         a = """str(x, y, z)"""
 #         self.check(b, a)
-# 
+#
 #     def test_unichr(self):
 #         b = """unichr(u'h')"""
 #         a = """chr('h')"""
 #         self.check(b, a)
-# 
+#
 #     def test_unicode_literal_1(self):
 #         b = '''u"x"'''
 #         a = '''"x"'''
 #         self.check(b, a)
-# 
+#
 #     def test_unicode_literal_2(self):
 #         b = """ur'x'"""
 #         a = """r'x'"""
 #         self.check(b, a)
-# 
+#
 #     def test_unicode_literal_3(self):
 #         b = """UR'''x''' """
 #         a = """R'''x''' """
 #         self.check(b, a)
-# 
+#
 # class Test_callable(FixerTestCase):
 #     fixer = "callable"
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = """callable(    x)"""
 #         a = """import collections\nisinstance(    x, collections.Callable)"""
 #         self.check(b, a)
-# 
+#
 #         b = """if     callable(x): pass"""
 #         a = """import collections
 # if     isinstance(x, collections.Callable): pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_callable_call(self):
 #         b = """callable(x)"""
 #         a = """import collections\nisinstance(x, collections.Callable)"""
 #         self.check(b, a)
-# 
+#
 #     def test_global_import(self):
 #         b = """
 # def spam(foo):
@@ -2716,14 +2716,14 @@ class Test_print(FixerTestCase):
 # def spam(foo):
 #     isinstance(foo, collections.Callable)"""[1:]
 #         self.check(b, a)
-# 
+#
 #         b = """
 # import collections
 # def spam(foo):
 #     callable(foo)"""[1:]
 #         # same output if it was already imported
 #         self.check(b, a)
-# 
+#
 #         b = """
 # from collections import *
 # def spam(foo):
@@ -2734,7 +2734,7 @@ class Test_print(FixerTestCase):
 # def spam(foo):
 #     isinstance(foo, collections.Callable)"""[1:]
 #         self.check(b, a)
-# 
+#
 #         b = """
 # do_stuff()
 # do_some_other_stuff()
@@ -2745,7 +2745,7 @@ class Test_print(FixerTestCase):
 # do_some_other_stuff()
 # assert isinstance(do_stuff, collections.Callable)"""[1:]
 #         self.check(b, a)
-# 
+#
 #         b = """
 # if isinstance(do_stuff, Callable):
 #     assert callable(do_stuff)
@@ -2768,55 +2768,55 @@ class Test_print(FixerTestCase):
 # else:
 #     assert not isinstance(do_stuff, collections.Callable)"""[1:]
 #         self.check(b, a)
-# 
+#
 #     def test_callable_should_not_change(self):
 #         a = """callable(*x)"""
 #         self.unchanged(a)
-# 
+#
 #         a = """callable(x, y)"""
 #         self.unchanged(a)
-# 
+#
 #         a = """callable(x, kw=y)"""
 #         self.unchanged(a)
-# 
+#
 #         a = """callable()"""
 #         self.unchanged(a)
-# 
+#
 # class Test_filter(FixerTestCase):
 #     fixer = "filter"
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = """x =   filter(    foo,     'abc'   )"""
 #         a = """x =   list(filter(    foo,     'abc'   ))"""
 #         self.check(b, a)
-# 
+#
 #         b = """x =   filter(  None , 'abc'  )"""
 #         a = """x =   [_f for _f in 'abc' if _f]"""
 #         self.check(b, a)
-# 
+#
 #     def test_filter_basic(self):
 #         b = """x = filter(None, 'abc')"""
 #         a = """x = [_f for _f in 'abc' if _f]"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = len(filter(f, 'abc'))"""
 #         a = """x = len(list(filter(f, 'abc')))"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = filter(lambda x: x%2 == 0, range(10))"""
 #         a = """x = [x for x in range(10) if x%2 == 0]"""
 #         self.check(b, a)
-# 
+#
 #         # Note the parens around x
 #         b = """x = filter(lambda (x): x%2 == 0, range(10))"""
 #         a = """x = [x for x in range(10) if x%2 == 0]"""
 #         self.check(b, a)
-# 
+#
 #         # XXX This (rare) case is not supported
 # ##         b = """x = filter(f, 'abc')[0]"""
 # ##         a = """x = list(filter(f, 'abc'))[0]"""
 # ##         self.check(b, a)
-# 
+#
 #     def test_filter_nochange(self):
 #         a = """b.join(filter(f, 'abc'))"""
 #         self.unchanged(a)
@@ -2856,62 +2856,62 @@ class Test_print(FixerTestCase):
 #         self.unchanged(a)
 #         a = """(x for x in filter(f, 'abc'))"""
 #         self.unchanged(a)
-# 
+#
 #     def test_future_builtins(self):
 #         a = "from future_builtins import spam, filter; filter(f, 'ham')"
 #         self.unchanged(a)
-# 
+#
 #         b = """from future_builtins import spam; x = filter(f, 'abc')"""
 #         a = """from future_builtins import spam; x = list(filter(f, 'abc'))"""
 #         self.check(b, a)
-# 
+#
 #         a = "from future_builtins import *; filter(f, 'ham')"
 #         self.unchanged(a)
-# 
+#
 # class Test_map(FixerTestCase):
 #     fixer = "map"
-# 
+#
 #     def check(self, b, a):
 #         self.unchanged("from future_builtins import map; " + b, a)
 #         super(Test_map, self).check(b, a)
-# 
+#
 #     def test_prefix_preservation(self):
 #         b = """x =    map(   f,    'abc'   )"""
 #         a = """x =    list(map(   f,    'abc'   ))"""
 #         self.check(b, a)
-# 
+#
 #     def test_trailing_comment(self):
 #         b = """x = map(f, 'abc')   #   foo"""
 #         a = """x = list(map(f, 'abc'))   #   foo"""
 #         self.check(b, a)
-# 
+#
 #     def test_None_with_multiple_arguments(self):
 #         s = """x = map(None, a, b, c)"""
 #         self.warns_unchanged(s, "cannot convert map(None, ...) with "
 #                              "multiple arguments")
-# 
+#
 #     def test_map_basic(self):
 #         b = """x = map(f, 'abc')"""
 #         a = """x = list(map(f, 'abc'))"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = len(map(f, 'abc', 'def'))"""
 #         a = """x = len(list(map(f, 'abc', 'def')))"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = map(None, 'abc')"""
 #         a = """x = list('abc')"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = map(lambda x: x+1, range(4))"""
 #         a = """x = [x+1 for x in range(4)]"""
 #         self.check(b, a)
-# 
+#
 #         # Note the parens around x
 #         b = """x = map(lambda (x): x+1, range(4))"""
 #         a = """x = [x+1 for x in range(4)]"""
 #         self.check(b, a)
-# 
+#
 #         b = """
 #             foo()
 #             # foo
@@ -2923,12 +2923,12 @@ class Test_print(FixerTestCase):
 #             list(map(f, x))
 #             """
 #         self.warns(b, a, "You should use a for loop here")
-# 
+#
 #         # XXX This (rare) case is not supported
 # ##         b = """x = map(f, 'abc')[0]"""
 # ##         a = """x = list(map(f, 'abc'))[0]"""
 # ##         self.check(b, a)
-# 
+#
 #     def test_map_nochange(self):
 #         a = """b.join(map(f, 'abc'))"""
 #         self.unchanged(a)
@@ -2968,34 +2968,34 @@ class Test_print(FixerTestCase):
 #         self.unchanged(a)
 #         a = """(x for x in map(f, 'abc'))"""
 #         self.unchanged(a)
-# 
+#
 #     def test_future_builtins(self):
 #         a = "from future_builtins import spam, map, eggs; map(f, 'ham')"
 #         self.unchanged(a)
-# 
+#
 #         b = """from future_builtins import spam, eggs; x = map(f, 'abc')"""
 #         a = """from future_builtins import spam, eggs; x = list(map(f, 'abc'))"""
 #         self.check(b, a)
-# 
+#
 #         a = "from future_builtins import *; map(f, 'ham')"
 #         self.unchanged(a)
-# 
+#
 # class Test_zip(FixerTestCase):
 #     fixer = "zip"
-# 
+#
 #     def check(self, b, a):
 #         self.unchanged("from future_builtins import zip; " + b, a)
 #         super(Test_zip, self).check(b, a)
-# 
+#
 #     def test_zip_basic(self):
 #         b = """x = zip(a, b, c)"""
 #         a = """x = list(zip(a, b, c))"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = len(zip(a, b))"""
 #         a = """x = len(list(zip(a, b)))"""
 #         self.check(b, a)
-# 
+#
 #     def test_zip_nochange(self):
 #         a = """b.join(zip(a, b))"""
 #         self.unchanged(a)
@@ -3035,74 +3035,74 @@ class Test_print(FixerTestCase):
 #         self.unchanged(a)
 #         a = """(x for x in zip(a, b))"""
 #         self.unchanged(a)
-# 
+#
 #     def test_future_builtins(self):
 #         a = "from future_builtins import spam, zip, eggs; zip(a, b)"
 #         self.unchanged(a)
-# 
+#
 #         b = """from future_builtins import spam, eggs; x = zip(a, b)"""
 #         a = """from future_builtins import spam, eggs; x = list(zip(a, b))"""
 #         self.check(b, a)
-# 
+#
 #         a = "from future_builtins import *; zip(a, b)"
 #         self.unchanged(a)
-# 
+#
 # class Test_standarderror(FixerTestCase):
 #     fixer = "standarderror"
-# 
+#
 #     def test(self):
 #         b = """x =    StandardError()"""
 #         a = """x =    Exception()"""
 #         self.check(b, a)
-# 
+#
 #         b = """x = StandardError(a, b, c)"""
 #         a = """x = Exception(a, b, c)"""
 #         self.check(b, a)
-# 
+#
 #         b = """f(2 + StandardError(a, b, c))"""
 #         a = """f(2 + Exception(a, b, c))"""
 #         self.check(b, a)
-# 
+#
 # class Test_types(FixerTestCase):
 #     fixer = "types"
-# 
+#
 #     def test_basic_types_convert(self):
 #         b = """types.StringType"""
 #         a = """bytes"""
 #         self.check(b, a)
-# 
+#
 #         b = """types.DictType"""
 #         a = """dict"""
 #         self.check(b, a)
-# 
+#
 #         b = """types . IntType"""
 #         a = """int"""
 #         self.check(b, a)
-# 
+#
 #         b = """types.ListType"""
 #         a = """list"""
 #         self.check(b, a)
-# 
+#
 #         b = """types.LongType"""
 #         a = """int"""
 #         self.check(b, a)
-# 
+#
 #         b = """types.NoneType"""
 #         a = """type(None)"""
 #         self.check(b, a)
-# 
+#
 # class Test_idioms(FixerTestCase):
 #     fixer = "idioms"
-# 
+#
 #     def test_while(self):
 #         b = """while 1: foo()"""
 #         a = """while True: foo()"""
 #         self.check(b, a)
-# 
+#
 #         b = """while   1: foo()"""
 #         a = """while   True: foo()"""
 #         self.check(b, a)
-# 
+#
 #         b = """
 #             while 1:
 #                 foo()
@@ -3112,132 +3112,132 @@ class Test_print(FixerTestCase):
 #                 foo()
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_while_unchanged(self):
 #         s = """while 11: foo()"""
 #         self.unchanged(s)
-# 
+#
 #         s = """while 0: foo()"""
 #         self.unchanged(s)
-# 
+#
 #         s = """while foo(): foo()"""
 #         self.unchanged(s)
-# 
+#
 #         s = """while []: foo()"""
 #         self.unchanged(s)
-# 
+#
 #     def test_eq_simple(self):
 #         b = """type(x) == T"""
 #         a = """isinstance(x, T)"""
 #         self.check(b, a)
-# 
+#
 #         b = """if   type(x) == T: pass"""
 #         a = """if   isinstance(x, T): pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_eq_reverse(self):
 #         b = """T == type(x)"""
 #         a = """isinstance(x, T)"""
 #         self.check(b, a)
-# 
+#
 #         b = """if   T == type(x): pass"""
 #         a = """if   isinstance(x, T): pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_eq_expression(self):
 #         b = """type(x+y) == d.get('T')"""
 #         a = """isinstance(x+y, d.get('T'))"""
 #         self.check(b, a)
-# 
+#
 #         b = """type(   x  +  y) == d.get('T')"""
 #         a = """isinstance(x  +  y, d.get('T'))"""
 #         self.check(b, a)
-# 
+#
 #     def test_is_simple(self):
 #         b = """type(x) is T"""
 #         a = """isinstance(x, T)"""
 #         self.check(b, a)
-# 
+#
 #         b = """if   type(x) is T: pass"""
 #         a = """if   isinstance(x, T): pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_is_reverse(self):
 #         b = """T is type(x)"""
 #         a = """isinstance(x, T)"""
 #         self.check(b, a)
-# 
+#
 #         b = """if   T is type(x): pass"""
 #         a = """if   isinstance(x, T): pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_is_expression(self):
 #         b = """type(x+y) is d.get('T')"""
 #         a = """isinstance(x+y, d.get('T'))"""
 #         self.check(b, a)
-# 
+#
 #         b = """type(   x  +  y) is d.get('T')"""
 #         a = """isinstance(x  +  y, d.get('T'))"""
 #         self.check(b, a)
-# 
+#
 #     def test_is_not_simple(self):
 #         b = """type(x) is not T"""
 #         a = """not isinstance(x, T)"""
 #         self.check(b, a)
-# 
+#
 #         b = """if   type(x) is not T: pass"""
 #         a = """if   not isinstance(x, T): pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_is_not_reverse(self):
 #         b = """T is not type(x)"""
 #         a = """not isinstance(x, T)"""
 #         self.check(b, a)
-# 
+#
 #         b = """if   T is not type(x): pass"""
 #         a = """if   not isinstance(x, T): pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_is_not_expression(self):
 #         b = """type(x+y) is not d.get('T')"""
 #         a = """not isinstance(x+y, d.get('T'))"""
 #         self.check(b, a)
-# 
+#
 #         b = """type(   x  +  y) is not d.get('T')"""
 #         a = """not isinstance(x  +  y, d.get('T'))"""
 #         self.check(b, a)
-# 
+#
 #     def test_ne_simple(self):
 #         b = """type(x) != T"""
 #         a = """not isinstance(x, T)"""
 #         self.check(b, a)
-# 
+#
 #         b = """if   type(x) != T: pass"""
 #         a = """if   not isinstance(x, T): pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_ne_reverse(self):
 #         b = """T != type(x)"""
 #         a = """not isinstance(x, T)"""
 #         self.check(b, a)
-# 
+#
 #         b = """if   T != type(x): pass"""
 #         a = """if   not isinstance(x, T): pass"""
 #         self.check(b, a)
-# 
+#
 #     def test_ne_expression(self):
 #         b = """type(x+y) != d.get('T')"""
 #         a = """not isinstance(x+y, d.get('T'))"""
 #         self.check(b, a)
-# 
+#
 #         b = """type(   x  +  y) != d.get('T')"""
 #         a = """not isinstance(x  +  y, d.get('T'))"""
 #         self.check(b, a)
-# 
+#
 #     def test_type_unchanged(self):
 #         a = """type(x).__name__"""
 #         self.unchanged(a)
-# 
+#
 #     def test_sort_list_call(self):
 #         b = """
 #             v = list(t)
@@ -3249,7 +3249,7 @@ class Test_print(FixerTestCase):
 #             foo(v)
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = """
 #             v = list(foo(b) + d)
 #             v.sort()
@@ -3260,7 +3260,7 @@ class Test_print(FixerTestCase):
 #             foo(v)
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = """
 #             while x:
 #                 v = list(t)
@@ -3273,7 +3273,7 @@ class Test_print(FixerTestCase):
 #                 foo(v)
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = """
 #             v = list(t)
 #             # foo
@@ -3286,7 +3286,7 @@ class Test_print(FixerTestCase):
 #             foo(v)
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = r"""
 #             v = list(   t)
 #             v.sort()
@@ -3297,21 +3297,21 @@ class Test_print(FixerTestCase):
 #             foo(v)
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = r"""
 #             try:
 #                 m = list(s)
 #                 m.sort()
 #             except: pass
 #             """
-# 
+#
 #         a = r"""
 #             try:
 #                 m = sorted(s)
 #             except: pass
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = r"""
 #             try:
 #                 m = list(s)
@@ -3319,7 +3319,7 @@ class Test_print(FixerTestCase):
 #                 m.sort()
 #             except: pass
 #             """
-# 
+#
 #         a = r"""
 #             try:
 #                 m = sorted(s)
@@ -3327,17 +3327,17 @@ class Test_print(FixerTestCase):
 #             except: pass
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = r"""
 #             m = list(s)
 #             # more comments
 #             m.sort()"""
-# 
+#
 #         a = r"""
 #             m = sorted(s)
 #             # more comments"""
 #         self.check(b, a)
-# 
+#
 #     def test_sort_simple_expr(self):
 #         b = """
 #             v = t
@@ -3349,7 +3349,7 @@ class Test_print(FixerTestCase):
 #             foo(v)
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = """
 #             v = foo(b)
 #             v.sort()
@@ -3360,7 +3360,7 @@ class Test_print(FixerTestCase):
 #             foo(v)
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = """
 #             v = b.keys()
 #             v.sort()
@@ -3371,7 +3371,7 @@ class Test_print(FixerTestCase):
 #             foo(v)
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = """
 #             v = foo(b) + d
 #             v.sort()
@@ -3382,7 +3382,7 @@ class Test_print(FixerTestCase):
 #             foo(v)
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = """
 #             while x:
 #                 v = t
@@ -3395,7 +3395,7 @@ class Test_print(FixerTestCase):
 #                 foo(v)
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = """
 #             v = t
 #             # foo
@@ -3408,7 +3408,7 @@ class Test_print(FixerTestCase):
 #             foo(v)
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = r"""
 #             v =   t
 #             v.sort()
@@ -3419,7 +3419,7 @@ class Test_print(FixerTestCase):
 #             foo(v)
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_sort_unchanged(self):
 #         s = """
 #             v = list(t)
@@ -3427,57 +3427,57 @@ class Test_print(FixerTestCase):
 #             foo(w)
 #             """
 #         self.unchanged(s)
-# 
+#
 #         s = """
 #             v = list(t)
 #             v.sort(u)
 #             foo(v)
 #             """
 #         self.unchanged(s)
-# 
+#
 # class Test_basestring(FixerTestCase):
 #     fixer = "basestring"
-# 
+#
 #     def test_basestring(self):
 #         b = """isinstance(x, basestring)"""
 #         a = """isinstance(x, str)"""
 #         self.check(b, a)
-# 
+#
 # class Test_buffer(FixerTestCase):
 #     fixer = "buffer"
-# 
+#
 #     def test_buffer(self):
 #         b = """x = buffer(y)"""
 #         a = """x = memoryview(y)"""
 #         self.check(b, a)
-# 
+#
 #     def test_slicing(self):
 #         b = """buffer(y)[4:5]"""
 #         a = """memoryview(y)[4:5]"""
 #         self.check(b, a)
-# 
+#
 # class Test_future(FixerTestCase):
 #     fixer = "future"
-# 
+#
 #     def test_future(self):
 #         b = """from __future__ import braces"""
 #         a = """"""
 #         self.check(b, a)
-# 
+#
 #         b = """# comment\nfrom __future__ import braces"""
 #         a = """# comment\n"""
 #         self.check(b, a)
-# 
+#
 #         b = """from __future__ import braces\n# comment"""
 #         a = """\n# comment"""
 #         self.check(b, a)
-# 
+#
 #     def test_run_order(self):
 #         self.assert_runs_after('print')
-# 
+#
 # class Test_itertools(FixerTestCase):
 #     fixer = "itertools"
-# 
+#
 #     def checkall(self, before, after):
 #         # Because we need to check with and without the itertools prefix
 #         # and on each of the three functions, these loops make it all
@@ -3487,132 +3487,132 @@ class Test_print(FixerTestCase):
 #                 b = before %(i+'i'+f)
 #                 a = after %(f)
 #                 self.check(b, a)
-# 
+#
 #     def test_0(self):
 #         # A simple example -- test_1 covers exactly the same thing,
 #         # but it's not quite as clear.
 #         b = "itertools.izip(a, b)"
 #         a = "zip(a, b)"
 #         self.check(b, a)
-# 
+#
 #     def test_1(self):
 #         b = """%s(f, a)"""
 #         a = """%s(f, a)"""
 #         self.checkall(b, a)
-# 
+#
 #     def test_qualified(self):
 #         b = """itertools.ifilterfalse(a, b)"""
 #         a = """itertools.filterfalse(a, b)"""
 #         self.check(b, a)
-# 
+#
 #         b = """itertools.izip_longest(a, b)"""
 #         a = """itertools.zip_longest(a, b)"""
 #         self.check(b, a)
-# 
+#
 #     def test_2(self):
 #         b = """ifilterfalse(a, b)"""
 #         a = """filterfalse(a, b)"""
 #         self.check(b, a)
-# 
+#
 #         b = """izip_longest(a, b)"""
 #         a = """zip_longest(a, b)"""
 #         self.check(b, a)
-# 
+#
 #     def test_space_1(self):
 #         b = """    %s(f, a)"""
 #         a = """    %s(f, a)"""
 #         self.checkall(b, a)
-# 
+#
 #     def test_space_2(self):
 #         b = """    itertools.ifilterfalse(a, b)"""
 #         a = """    itertools.filterfalse(a, b)"""
 #         self.check(b, a)
-# 
+#
 #         b = """    itertools.izip_longest(a, b)"""
 #         a = """    itertools.zip_longest(a, b)"""
 #         self.check(b, a)
-# 
+#
 #     def test_run_order(self):
 #         self.assert_runs_after('map', 'zip', 'filter')
-# 
-# 
+#
+#
 # class Test_itertools_imports(FixerTestCase):
 #     fixer = 'itertools_imports'
-# 
+#
 #     def test_reduced(self):
 #         b = "from itertools import imap, izip, foo"
 #         a = "from itertools import foo"
 #         self.check(b, a)
-# 
+#
 #         b = "from itertools import bar, imap, izip, foo"
 #         a = "from itertools import bar, foo"
 #         self.check(b, a)
-# 
+#
 #         b = "from itertools import chain, imap, izip"
 #         a = "from itertools import chain"
 #         self.check(b, a)
-# 
+#
 #     def test_comments(self):
 #         b = "#foo\nfrom itertools import imap, izip"
 #         a = "#foo\n"
 #         self.check(b, a)
-# 
+#
 #     def test_none(self):
 #         b = "from itertools import imap, izip"
 #         a = ""
 #         self.check(b, a)
-# 
+#
 #         b = "from itertools import izip"
 #         a = ""
 #         self.check(b, a)
-# 
+#
 #     def test_import_as(self):
 #         b = "from itertools import izip, bar as bang, imap"
 #         a = "from itertools import bar as bang"
 #         self.check(b, a)
-# 
+#
 #         b = "from itertools import izip as _zip, imap, bar"
 #         a = "from itertools import bar"
 #         self.check(b, a)
-# 
+#
 #         b = "from itertools import imap as _map"
 #         a = ""
 #         self.check(b, a)
-# 
+#
 #         b = "from itertools import imap as _map, izip as _zip"
 #         a = ""
 #         self.check(b, a)
-# 
+#
 #         s = "from itertools import bar as bang"
 #         self.unchanged(s)
-# 
+#
 #     def test_ifilter_and_zip_longest(self):
 #         for name in "filterfalse", "zip_longest":
 #             b = "from itertools import i%s" % (name,)
 #             a = "from itertools import %s" % (name,)
 #             self.check(b, a)
-# 
+#
 #             b = "from itertools import imap, i%s, foo" % (name,)
 #             a = "from itertools import %s, foo" % (name,)
 #             self.check(b, a)
-# 
+#
 #             b = "from itertools import bar, i%s, foo" % (name,)
 #             a = "from itertools import bar, %s, foo" % (name,)
 #             self.check(b, a)
-# 
+#
 #     def test_import_star(self):
 #         s = "from itertools import *"
 #         self.unchanged(s)
-# 
-# 
+#
+#
 #     def test_unchanged(self):
 #         s = "from itertools import foo"
 #         self.unchanged(s)
-# 
-# 
+#
+#
 # class Test_import(FixerTestCase):
 #     fixer = "import"
-# 
+#
 #     def setUp(self):
 #         super(Test_import, self).setUp()
 #         # Need to replace fix_import's exists method
@@ -3623,145 +3623,145 @@ class Test_print(FixerTestCase):
 #         def fake_exists(name):
 #             self.files_checked.append(name)
 #             return self.always_exists or (name in self.present_files)
-# 
+#
 #         from lib2to3.fixes import fix_import
 #         fix_import.exists = fake_exists
-# 
+#
 #     def tearDown(self):
 #         from lib2to3.fixes import fix_import
 #         fix_import.exists = os.path.exists
-# 
+#
 #     def check_both(self, b, a):
 #         self.always_exists = True
 #         super(Test_import, self).check(b, a)
 #         self.always_exists = False
 #         super(Test_import, self).unchanged(b)
-# 
+#
 #     def test_files_checked(self):
 #         def p(path):
 #             # Takes a unix path and returns a path with correct separators
 #             return os.path.pathsep.join(path.split("/"))
-# 
+#
 #         self.always_exists = False
 #         self.present_files = set(['__init__.py'])
 #         expected_extensions = ('.py', os.path.sep, '.pyc', '.so', '.sl', '.pyd')
 #         names_to_test = (p("/spam/eggs.py"), "ni.py", p("../../shrubbery.py"))
-# 
+#
 #         for name in names_to_test:
 #             self.files_checked = []
 #             self.filename = name
 #             self.unchanged("import jam")
-# 
+#
 #             if os.path.dirname(name):
 #                 name = os.path.dirname(name) + '/jam'
 #             else:
 #                 name = 'jam'
 #             expected_checks = set(name + ext for ext in expected_extensions)
 #             expected_checks.add("__init__.py")
-# 
+#
 #             self.assertEqual(set(self.files_checked), expected_checks)
-# 
+#
 #     def test_not_in_package(self):
 #         s = "import bar"
 #         self.always_exists = False
 #         self.present_files = set(["bar.py"])
 #         self.unchanged(s)
-# 
+#
 #     def test_with_absolute_import_enabled(self):
 #         s = "from __future__ import absolute_import\nimport bar"
 #         self.always_exists = False
 #         self.present_files = set(["__init__.py", "bar.py"])
 #         self.unchanged(s)
-# 
+#
 #     def test_in_package(self):
 #         b = "import bar"
 #         a = "from . import bar"
 #         self.always_exists = False
 #         self.present_files = set(["__init__.py", "bar.py"])
 #         self.check(b, a)
-# 
+#
 #     def test_import_from_package(self):
 #         b = "import bar"
 #         a = "from . import bar"
 #         self.always_exists = False
 #         self.present_files = set(["__init__.py", "bar" + os.path.sep])
 #         self.check(b, a)
-# 
+#
 #     def test_already_relative_import(self):
 #         s = "from . import bar"
 #         self.unchanged(s)
-# 
+#
 #     def test_comments_and_indent(self):
 #         b = "import bar # Foo"
 #         a = "from . import bar # Foo"
 #         self.check(b, a)
-# 
+#
 #     def test_from(self):
 #         b = "from foo import bar, baz"
 #         a = "from .foo import bar, baz"
 #         self.check_both(b, a)
-# 
+#
 #         b = "from foo import bar"
 #         a = "from .foo import bar"
 #         self.check_both(b, a)
-# 
+#
 #         b = "from foo import (bar, baz)"
 #         a = "from .foo import (bar, baz)"
 #         self.check_both(b, a)
-# 
+#
 #     def test_dotted_from(self):
 #         b = "from green.eggs import ham"
 #         a = "from .green.eggs import ham"
 #         self.check_both(b, a)
-# 
+#
 #     def test_from_as(self):
 #         b = "from green.eggs import ham as spam"
 #         a = "from .green.eggs import ham as spam"
 #         self.check_both(b, a)
-# 
+#
 #     def test_import(self):
 #         b = "import foo"
 #         a = "from . import foo"
 #         self.check_both(b, a)
-# 
+#
 #         b = "import foo, bar"
 #         a = "from . import foo, bar"
 #         self.check_both(b, a)
-# 
+#
 #         b = "import foo, bar, x"
 #         a = "from . import foo, bar, x"
 #         self.check_both(b, a)
-# 
+#
 #         b = "import x, y, z"
 #         a = "from . import x, y, z"
 #         self.check_both(b, a)
-# 
+#
 #     def test_import_as(self):
 #         b = "import foo as x"
 #         a = "from . import foo as x"
 #         self.check_both(b, a)
-# 
+#
 #         b = "import a as b, b as c, c as d"
 #         a = "from . import a as b, b as c, c as d"
 #         self.check_both(b, a)
-# 
+#
 #     def test_local_and_absolute(self):
 #         self.always_exists = False
 #         self.present_files = set(["foo.py", "__init__.py"])
-# 
+#
 #         s = "import foo, bar"
 #         self.warns_unchanged(s, "absolute and local imports together")
-# 
+#
 #     def test_dotted_import(self):
 #         b = "import foo.bar"
 #         a = "from . import foo.bar"
 #         self.check_both(b, a)
-# 
+#
 #     def test_dotted_import_as(self):
 #         b = "import foo.bar as bang"
 #         a = "from . import foo.bar as bang"
 #         self.check_both(b, a)
-# 
+#
 #     def test_prefix(self):
 #         b = """
 #         # prefix
@@ -3772,101 +3772,101 @@ class Test_print(FixerTestCase):
 #         from . import foo.bar
 #         """
 #         self.check_both(b, a)
-# 
-# 
+#
+#
 # class Test_set_literal(FixerTestCase):
-# 
+#
 #     fixer = "set_literal"
-# 
+#
 #     def test_basic(self):
 #         b = """set([1, 2, 3])"""
 #         a = """{1, 2, 3}"""
 #         self.check(b, a)
-# 
+#
 #         b = """set((1, 2, 3))"""
 #         a = """{1, 2, 3}"""
 #         self.check(b, a)
-# 
+#
 #         b = """set((1,))"""
 #         a = """{1}"""
 #         self.check(b, a)
-# 
+#
 #         b = """set([1])"""
 #         self.check(b, a)
-# 
+#
 #         b = """set((a, b))"""
 #         a = """{a, b}"""
 #         self.check(b, a)
-# 
+#
 #         b = """set([a, b])"""
 #         self.check(b, a)
-# 
+#
 #         b = """set((a*234, f(args=23)))"""
 #         a = """{a*234, f(args=23)}"""
 #         self.check(b, a)
-# 
+#
 #         b = """set([a*23, f(23)])"""
 #         a = """{a*23, f(23)}"""
 #         self.check(b, a)
-# 
+#
 #         b = """set([a-234**23])"""
 #         a = """{a-234**23}"""
 #         self.check(b, a)
-# 
+#
 #     def test_listcomps(self):
 #         b = """set([x for x in y])"""
 #         a = """{x for x in y}"""
 #         self.check(b, a)
-# 
+#
 #         b = """set([x for x in y if x == m])"""
 #         a = """{x for x in y if x == m}"""
 #         self.check(b, a)
-# 
+#
 #         b = """set([x for x in y for a in b])"""
 #         a = """{x for x in y for a in b}"""
 #         self.check(b, a)
-# 
+#
 #         b = """set([f(x) - 23 for x in y])"""
 #         a = """{f(x) - 23 for x in y}"""
 #         self.check(b, a)
-# 
+#
 #     def test_whitespace(self):
 #         b = """set( [1, 2])"""
 #         a = """{1, 2}"""
 #         self.check(b, a)
-# 
+#
 #         b = """set([1 ,  2])"""
 #         a = """{1 ,  2}"""
 #         self.check(b, a)
-# 
+#
 #         b = """set([ 1 ])"""
 #         a = """{ 1 }"""
 #         self.check(b, a)
-# 
+#
 #         b = """set( [1] )"""
 #         a = """{1}"""
 #         self.check(b, a)
-# 
+#
 #         b = """set([  1,  2  ])"""
 #         a = """{  1,  2  }"""
 #         self.check(b, a)
-# 
+#
 #         b = """set([x  for x in y ])"""
 #         a = """{x  for x in y }"""
 #         self.check(b, a)
-# 
+#
 #         b = """set(
 #                    [1, 2]
 #                )
 #             """
 #         a = """{1, 2}\n"""
 #         self.check(b, a)
-# 
+#
 #     def test_comments(self):
 #         b = """set((1, 2)) # Hi"""
 #         a = """{1, 2} # Hi"""
 #         self.check(b, a)
-# 
+#
 #         # This isn't optimal behavior, but the fixer is optional.
 #         b = """
 #             # Foo
@@ -3879,124 +3879,124 @@ class Test_print(FixerTestCase):
 #             {1, 2}
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_unchanged(self):
 #         s = """set()"""
 #         self.unchanged(s)
-# 
+#
 #         s = """set(a)"""
 #         self.unchanged(s)
-# 
+#
 #         s = """set(a, b, c)"""
 #         self.unchanged(s)
-# 
+#
 #         # Don't transform generators because they might have to be lazy.
 #         s = """set(x for x in y)"""
 #         self.unchanged(s)
-# 
+#
 #         s = """set(x for x in y if z)"""
 #         self.unchanged(s)
-# 
+#
 #         s = """set(a*823-23**2 + f(23))"""
 #         self.unchanged(s)
-# 
-# 
+#
+#
 # class Test_sys_exc(FixerTestCase):
 #     fixer = "sys_exc"
-# 
+#
 #     def test_0(self):
 #         b = "sys.exc_type"
 #         a = "sys.exc_info()[0]"
 #         self.check(b, a)
-# 
+#
 #     def test_1(self):
 #         b = "sys.exc_value"
 #         a = "sys.exc_info()[1]"
 #         self.check(b, a)
-# 
+#
 #     def test_2(self):
 #         b = "sys.exc_traceback"
 #         a = "sys.exc_info()[2]"
 #         self.check(b, a)
-# 
+#
 #     def test_3(self):
 #         b = "sys.exc_type # Foo"
 #         a = "sys.exc_info()[0] # Foo"
 #         self.check(b, a)
-# 
+#
 #     def test_4(self):
 #         b = "sys.  exc_type"
 #         a = "sys.  exc_info()[0]"
 #         self.check(b, a)
-# 
+#
 #     def test_5(self):
 #         b = "sys  .exc_type"
 #         a = "sys  .exc_info()[0]"
 #         self.check(b, a)
-# 
-# 
+#
+#
 # class Test_paren(FixerTestCase):
 #     fixer = "paren"
-# 
+#
 #     def test_0(self):
 #         b = """[i for i in 1, 2 ]"""
 #         a = """[i for i in (1, 2) ]"""
 #         self.check(b, a)
-# 
+#
 #     def test_1(self):
 #         b = """[i for i in 1, 2, ]"""
 #         a = """[i for i in (1, 2,) ]"""
 #         self.check(b, a)
-# 
+#
 #     def test_2(self):
 #         b = """[i for i  in     1, 2 ]"""
 #         a = """[i for i  in     (1, 2) ]"""
 #         self.check(b, a)
-# 
+#
 #     def test_3(self):
 #         b = """[i for i in 1, 2 if i]"""
 #         a = """[i for i in (1, 2) if i]"""
 #         self.check(b, a)
-# 
+#
 #     def test_4(self):
 #         b = """[i for i in 1,    2    ]"""
 #         a = """[i for i in (1,    2)    ]"""
 #         self.check(b, a)
-# 
+#
 #     def test_5(self):
 #         b = """(i for i in 1, 2)"""
 #         a = """(i for i in (1, 2))"""
 #         self.check(b, a)
-# 
+#
 #     def test_6(self):
 #         b = """(i for i in 1   ,2   if i)"""
 #         a = """(i for i in (1   ,2)   if i)"""
 #         self.check(b, a)
-# 
+#
 #     def test_unchanged_0(self):
 #         s = """[i for i in (1, 2)]"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_1(self):
 #         s = """[i for i in foo()]"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_2(self):
 #         s = """[i for i in (1, 2) if nothing]"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_3(self):
 #         s = """(i for i in (1, 2))"""
 #         self.unchanged(s)
-# 
+#
 #     def test_unchanged_4(self):
 #         s = """[i for i in m]"""
 #         self.unchanged(s)
-# 
+#
 # class Test_metaclass(FixerTestCase):
-# 
+#
 #     fixer = 'metaclass'
-# 
+#
 #     def test_unchanged(self):
 #         self.unchanged("class X(): pass")
 #         self.unchanged("class X(object): pass")
@@ -4005,19 +4005,19 @@ class Test_print(FixerTestCase):
 #         self.unchanged("class X(metaclass=Meta): pass")
 #         self.unchanged("class X(b, arg=23, metclass=Meta): pass")
 #         self.unchanged("class X(b, arg=23, metaclass=Meta, other=42): pass")
-# 
+#
 #         s = """
 #         class X:
 #             def __metaclass__(self): pass
 #         """
 #         self.unchanged(s)
-# 
+#
 #         s = """
 #         class X:
 #             a[23] = 74
 #         """
 #         self.unchanged(s)
-# 
+#
 #     def test_comments(self):
 #         b = """
 #         class X:
@@ -4030,7 +4030,7 @@ class Test_print(FixerTestCase):
 #             pass
 #         """
 #         self.check(b, a)
-# 
+#
 #         b = """
 #         class X:
 #             __metaclass__ = Meta
@@ -4042,7 +4042,7 @@ class Test_print(FixerTestCase):
 #             # Bedtime!
 #         """
 #         self.check(b, a)
-# 
+#
 #     def test_meta(self):
 #         # no-parent class, odd body
 #         b = """
@@ -4055,13 +4055,13 @@ class Test_print(FixerTestCase):
 #             pass
 #         """
 #         self.check(b, a)
-# 
+#
 #         # one parent class, no body
 #         b = """class X(object): __metaclass__ = Q"""
 #         a = """class X(object, metaclass=Q): pass"""
 #         self.check(b, a)
-# 
-# 
+#
+#
 #         # one parent, simple body
 #         b = """
 #         class X(object):
@@ -4073,7 +4073,7 @@ class Test_print(FixerTestCase):
 #             bar = 7
 #         """
 #         self.check(b, a)
-# 
+#
 #         b = """
 #         class X:
 #             __metaclass__ = Meta; x = 4; g = 23
@@ -4083,7 +4083,7 @@ class Test_print(FixerTestCase):
 #             x = 4; g = 23
 #         """
 #         self.check(b, a)
-# 
+#
 #         # one parent, simple body, __metaclass__ last
 #         b = """
 #         class X(object):
@@ -4095,7 +4095,7 @@ class Test_print(FixerTestCase):
 #             bar = 7
 #         """
 #         self.check(b, a)
-# 
+#
 #         # redefining __metaclass__
 #         b = """
 #         class X():
@@ -4108,7 +4108,7 @@ class Test_print(FixerTestCase):
 #             bar = 7
 #         """
 #         self.check(b, a)
-# 
+#
 #         # multiple inheritance, simple body
 #         b = """
 #         class X(clsA, clsB):
@@ -4120,12 +4120,12 @@ class Test_print(FixerTestCase):
 #             bar = 7
 #         """
 #         self.check(b, a)
-# 
+#
 #         # keywords in the class statement
 #         b = """class m(a, arg=23): __metaclass__ = Meta"""
 #         a = """class m(a, arg=23, metaclass=Meta): pass"""
 #         self.check(b, a)
-# 
+#
 #         b = """
 #         class X(expression(2 + 4)):
 #             __metaclass__ = Meta
@@ -4135,7 +4135,7 @@ class Test_print(FixerTestCase):
 #             pass
 #         """
 #         self.check(b, a)
-# 
+#
 #         b = """
 #         class X(expression(2 + 4), x**4):
 #             __metaclass__ = Meta
@@ -4145,7 +4145,7 @@ class Test_print(FixerTestCase):
 #             pass
 #         """
 #         self.check(b, a)
-# 
+#
 #         b = """
 #         class X:
 #             __metaclass__ = Meta
@@ -4156,44 +4156,44 @@ class Test_print(FixerTestCase):
 #             save.py = 23
 #         """
 #         self.check(b, a)
-# 
-# 
+#
+#
 # class Test_getcwdu(FixerTestCase):
-# 
+#
 #     fixer = 'getcwdu'
-# 
+#
 #     def test_basic(self):
 #         b = """os.getcwdu"""
 #         a = """os.getcwd"""
 #         self.check(b, a)
-# 
+#
 #         b = """os.getcwdu()"""
 #         a = """os.getcwd()"""
 #         self.check(b, a)
-# 
+#
 #         b = """meth = os.getcwdu"""
 #         a = """meth = os.getcwd"""
 #         self.check(b, a)
-# 
+#
 #         b = """os.getcwdu(args)"""
 #         a = """os.getcwd(args)"""
 #         self.check(b, a)
-# 
+#
 #     def test_comment(self):
 #         b = """os.getcwdu() # Foo"""
 #         a = """os.getcwd() # Foo"""
 #         self.check(b, a)
-# 
+#
 #     def test_unchanged(self):
 #         s = """os.getcwd()"""
 #         self.unchanged(s)
-# 
+#
 #         s = """getcwdu()"""
 #         self.unchanged(s)
-# 
+#
 #         s = """os.getcwdb()"""
 #         self.unchanged(s)
-# 
+#
 #     def test_indentation(self):
 #         b = """
 #             if 1:
@@ -4204,124 +4204,124 @@ class Test_print(FixerTestCase):
 #                 os.getcwd()
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_multilation(self):
 #         b = """os .getcwdu()"""
 #         a = """os .getcwd()"""
 #         self.check(b, a)
-# 
+#
 #         b = """os.  getcwdu"""
 #         a = """os.  getcwd"""
 #         self.check(b, a)
-# 
+#
 #         b = """os.getcwdu (  )"""
 #         a = """os.getcwd (  )"""
 #         self.check(b, a)
-# 
-# 
+#
+#
 # class Test_operator(FixerTestCase):
-# 
+#
 #     fixer = "operator"
-# 
+#
 #     def test_operator_isCallable(self):
 #         b = "operator.isCallable(x)"
 #         a = "hasattr(x, '__call__')"
 #         self.check(b, a)
-# 
+#
 #     def test_operator_sequenceIncludes(self):
 #         b = "operator.sequenceIncludes(x, y)"
 #         a = "operator.contains(x, y)"
 #         self.check(b, a)
-# 
+#
 #         b = "operator .sequenceIncludes(x, y)"
 #         a = "operator .contains(x, y)"
 #         self.check(b, a)
-# 
+#
 #         b = "operator.  sequenceIncludes(x, y)"
 #         a = "operator.  contains(x, y)"
 #         self.check(b, a)
-# 
+#
 #     def test_operator_isSequenceType(self):
 #         b = "operator.isSequenceType(x)"
 #         a = "import collections\nisinstance(x, collections.Sequence)"
 #         self.check(b, a)
-# 
+#
 #     def test_operator_isMappingType(self):
 #         b = "operator.isMappingType(x)"
 #         a = "import collections\nisinstance(x, collections.Mapping)"
 #         self.check(b, a)
-# 
+#
 #     def test_operator_isNumberType(self):
 #         b = "operator.isNumberType(x)"
 #         a = "import numbers\nisinstance(x, numbers.Number)"
 #         self.check(b, a)
-# 
+#
 #     def test_operator_repeat(self):
 #         b = "operator.repeat(x, n)"
 #         a = "operator.mul(x, n)"
 #         self.check(b, a)
-# 
+#
 #         b = "operator .repeat(x, n)"
 #         a = "operator .mul(x, n)"
 #         self.check(b, a)
-# 
+#
 #         b = "operator.  repeat(x, n)"
 #         a = "operator.  mul(x, n)"
 #         self.check(b, a)
-# 
+#
 #     def test_operator_irepeat(self):
 #         b = "operator.irepeat(x, n)"
 #         a = "operator.imul(x, n)"
 #         self.check(b, a)
-# 
+#
 #         b = "operator .irepeat(x, n)"
 #         a = "operator .imul(x, n)"
 #         self.check(b, a)
-# 
+#
 #         b = "operator.  irepeat(x, n)"
 #         a = "operator.  imul(x, n)"
 #         self.check(b, a)
-# 
+#
 #     def test_bare_isCallable(self):
 #         s = "isCallable(x)"
 #         t = "You should use 'hasattr(x, '__call__')' here."
 #         self.warns_unchanged(s, t)
-# 
+#
 #     def test_bare_sequenceIncludes(self):
 #         s = "sequenceIncludes(x, y)"
 #         t = "You should use 'operator.contains(x, y)' here."
 #         self.warns_unchanged(s, t)
-# 
+#
 #     def test_bare_operator_isSequenceType(self):
 #         s = "isSequenceType(z)"
 #         t = "You should use 'isinstance(z, collections.Sequence)' here."
 #         self.warns_unchanged(s, t)
-# 
+#
 #     def test_bare_operator_isMappingType(self):
 #         s = "isMappingType(x)"
 #         t = "You should use 'isinstance(x, collections.Mapping)' here."
 #         self.warns_unchanged(s, t)
-# 
+#
 #     def test_bare_operator_isNumberType(self):
 #         s = "isNumberType(y)"
 #         t = "You should use 'isinstance(y, numbers.Number)' here."
 #         self.warns_unchanged(s, t)
-# 
+#
 #     def test_bare_operator_repeat(self):
 #         s = "repeat(x, n)"
 #         t = "You should use 'operator.mul(x, n)' here."
 #         self.warns_unchanged(s, t)
-# 
+#
 #     def test_bare_operator_irepeat(self):
 #         s = "irepeat(y, 187)"
 #         t = "You should use 'operator.imul(y, 187)' here."
 #         self.warns_unchanged(s, t)
-# 
-# 
+#
+#
 # class Test_exitfunc(FixerTestCase):
-# 
+#
 #     fixer = "exitfunc"
-# 
+#
 #     def test_simple(self):
 #         b = """
 #             import sys
@@ -4333,7 +4333,7 @@ class Test_print(FixerTestCase):
 #             atexit.register(my_atexit)
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_names_import(self):
 #         b = """
 #             import sys, crumbs
@@ -4344,7 +4344,7 @@ class Test_print(FixerTestCase):
 #             atexit.register(my_func)
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_complex_expression(self):
 #         b = """
 #             import sys
@@ -4356,7 +4356,7 @@ class Test_print(FixerTestCase):
 #             atexit.register(do(d)/a()+complex(f=23, g=23)*expression)
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_comments(self):
 #         b = """
 #             import sys # Foo
@@ -4368,7 +4368,7 @@ class Test_print(FixerTestCase):
 #             atexit.register(f) # Blah
 #             """
 #         self.check(b, a)
-# 
+#
 #         b = """
 #             import apples, sys, crumbs, larry # Pleasant comments
 #             sys.exitfunc = func
@@ -4378,7 +4378,7 @@ class Test_print(FixerTestCase):
 #             atexit.register(func)
 #             """
 #         self.check(b, a)
-# 
+#
 #     def test_in_a_function(self):
 #         b = """
 #             import sys
@@ -4392,15 +4392,15 @@ class Test_print(FixerTestCase):
 #                 atexit.register(func)
 #              """
 #         self.check(b, a)
-# 
+#
 #     def test_no_sys_import(self):
 #         b = """sys.exitfunc = f"""
 #         a = """atexit.register(f)"""
 #         msg = ("Can't find sys import; Please add an atexit import at the "
 #             "top of your file.")
 #         self.warns(b, a, msg)
-# 
-# 
+#
+#
 #     def test_unchanged(self):
 #         s = """f(sys.exitfunc)"""
 #         self.unchanged(s)
diff --git a/tests/test_future/test_magicsuper.py b/tests/test_future/test_magicsuper.py
index 8b725d28be5d0bea1fa3e4923a4bc02c4233ca9c..e5bbe09328a49364c7b8de6c6c5312230cdf6012 100644
--- a/tests/test_future/test_magicsuper.py
+++ b/tests/test_future/test_magicsuper.py
@@ -133,4 +133,3 @@ class TestMagicSuper(unittest.TestCase):
 
 if __name__ == '__main__':
     unittest.main()
-
diff --git a/tests/test_future/test_object.py b/tests/test_future/test_object.py
index 07715029078718bb73c361a46593ab62fc3b7f11..8352f3a3b4f6893162f3f9847b9e6e94879c4f7d 100644
--- a/tests/test_future/test_object.py
+++ b/tests/test_future/test_object.py
@@ -39,7 +39,7 @@ class TestNewObject(unittest.TestCase):
             assert str(a) == str(b)
 
     def test_implements_py2_iterator(self):
-        
+
         class Upper(object):
             def __init__(self, iterable):
                 self._iter = iter(iterable)
@@ -57,7 +57,7 @@ class TestNewObject(unittest.TestCase):
                 return 'Next!'
             def __iter__(self):
                 return self
-        
+
         itr = MyIter()
         self.assertEqual(next(itr), 'Next!')
 
@@ -68,7 +68,7 @@ class TestNewObject(unittest.TestCase):
             self.assertEqual(item, 'Next!')
 
     def test_implements_py2_nonzero(self):
-        
+
         class EvenIsTrue(object):
             """
             An integer that evaluates to True if even.
@@ -94,7 +94,7 @@ class TestNewObject(unittest.TestCase):
         maps to __bool__ in case the user redefines __bool__ in a subclass of
         newint.
         """
-        
+
         class EvenIsTrue(int):
             """
             An integer that evaluates to True if even.
@@ -137,7 +137,7 @@ class TestNewObject(unittest.TestCase):
 
     def test_isinstance_object_subclass(self):
         """
-        This was failing before 
+        This was failing before
         """
         class A(object):
             pass
diff --git a/tests/test_future/test_pasteurize.py b/tests/test_future/test_pasteurize.py
index b09e3cba43aa3d9c4be9e198b1eb53515e91d394..2b6e2ee6ccfc56b385235f145da48f3c89215660 100644
--- a/tests/test_future/test_pasteurize.py
+++ b/tests/test_future/test_pasteurize.py
@@ -96,7 +96,7 @@ class TestPasteurize(CodeHandler):
     def test_urllib_request(self):
         """
         Example Python 3 code using the new urllib.request module.
-        
+
         Does the ``pasteurize`` script handle this?
         """
         before = """
@@ -105,7 +105,7 @@ class TestPasteurize(CodeHandler):
 
             URL = 'http://pypi.python.org/pypi/{}/json'
             package = 'future'
-            
+
             r = urllib.request.urlopen(URL.format(package))
             pprint.pprint(r.read())
         """
@@ -115,7 +115,7 @@ class TestPasteurize(CodeHandler):
 
             URL = 'http://pypi.python.org/pypi/{}/json'
             package = 'future'
-            
+
             r = urllib_request.urlopen(URL.format(package))
             pprint.pprint(r.read())
         """
@@ -150,7 +150,7 @@ class TestPasteurize(CodeHandler):
         retcode = main([self.textfilename])
         self.assertTrue(isinstance(retcode, int))   # i.e. Py2 builtin int
 
- 
+
 class TestFuturizeAnnotations(CodeHandler):
     @unittest.expectedFailure
     def test_return_annotations_alone(self):
@@ -250,7 +250,7 @@ class TestFuturizeAnnotations(CodeHandler):
             pass
         """
         self.unchanged(s, from3=True)
-        
+
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/tests/test_future/test_range.py b/tests/test_future/test_range.py
index c14f168f9ae8fbf6136f810ef8fea20cfb91e281..2e9471aec7c702351ad5919333a738a549822fae 100644
--- a/tests/test_future/test_range.py
+++ b/tests/test_future/test_range.py
@@ -26,6 +26,12 @@ class RangeTests(unittest.TestCase):
         self.assertEqual(range(0), range(1, 1))
         self.assertEqual(range(0, 10, 3), range(0, 11, 3))
 
+    def test_contains(self):
+        self.assertIn(1, range(2))
+        self.assertNotIn(10, range(2))
+        self.assertNotIn(None, range(2))
+        self.assertNotIn("", range(2))
+
     # Use strict equality of attributes when slicing to catch subtle differences
     def assertRangesEqual(self, r1, r2):
         by_attrs = attrgetter('start', 'stop', 'step')
diff --git a/tests/test_future/test_standard_library.py b/tests/test_future/test_standard_library.py
index 647da550bbcaaf016b74eb7513880a6bfa57041f..3ac5d2d71cefffbdf9e3d80188e1e5fcc21dcc82 100644
--- a/tests/test_future/test_standard_library.py
+++ b/tests/test_future/test_standard_library.py
@@ -30,7 +30,7 @@ class TestStandardLibraryReorganization(CodeHandler):
         """
         This test failed in v0.12-pre if e.g.
         future/standard_library/email/header.py contained:
-        
+
             from future import standard_library
             standard_library.remove_hooks()
         """
@@ -247,6 +247,13 @@ class TestStandardLibraryReorganization(CodeHandler):
         self.assertEqual(list(zip_longest(a, b)),
                          [(1, 2), (2, 4), (None, 6)])
 
+    def test_ChainMap(self):
+        """
+        Tests whether collections.ChainMap is available.
+        """
+        from collections import ChainMap
+        cm = ChainMap()
+
     @unittest.expectedFailure
     @unittest.skipIf(utils.PY3, 'generic import tests are for Py2 only')
     def test_import_failure_from_module(self):
@@ -274,7 +281,7 @@ class TestStandardLibraryReorganization(CodeHandler):
     # Disabled since v0.16.0:
     # def test_configparser(self):
     #     import configparser
-    
+
     def test_copyreg(self):
         import copyreg
 
@@ -283,7 +290,7 @@ class TestStandardLibraryReorganization(CodeHandler):
 
     def test_profile(self):
         import profile
-    
+
     def test_stringio(self):
         from io import StringIO
         s = StringIO(u'test')
@@ -319,7 +326,7 @@ class TestStandardLibraryReorganization(CodeHandler):
         import builtins
         self.assertTrue(hasattr(builtins, 'tuple'))
 
-    # @unittest.skip("ssl support has been stripped out for now ...")
+    @unittest.skip("ssl redirect support on pypi isn't working as expected for now ...")
     def test_urllib_request_ssl_redirect(self):
         """
         This site redirects to https://...
diff --git a/tests/test_future/test_str.py b/tests/test_future/test_str.py
index 7e37a62fca6cd5bbbb111055d5ee3a73071e38d7..dcc15628040a2aa1c9fd3e68bd8d6842af43e601 100644
--- a/tests/test_future/test_str.py
+++ b/tests/test_future/test_str.py
@@ -258,7 +258,7 @@ class TestStr(unittest.TestCase):
         if utils.PY2:
             self.assertTrue(b'A' in s)
         with self.assertRaises(TypeError):
-            bytes(b'A') in s                  
+            bytes(b'A') in s
         with self.assertRaises(TypeError):
             65 in s                                 # unlike bytes
 
@@ -382,10 +382,6 @@ class TestStr(unittest.TestCase):
             s > 3
         with self.assertRaises(TypeError):
             s < 1000
-        with self.assertRaises(TypeError):
-            s > b'XYZ'
-        with self.assertRaises(TypeError):
-            s < b'XYZ'
         with self.assertRaises(TypeError):
             s <= 3
         with self.assertRaises(TypeError):
diff --git a/tests/test_future/test_surrogateescape.py b/tests/test_future/test_surrogateescape.py
index 0057ba364b2c2d0d3aaee96a2597fe1bd4f6008c..7789ce9dd2c51db15377c8fe9a0bdd21eca617c9 100644
--- a/tests/test_future/test_surrogateescape.py
+++ b/tests/test_future/test_surrogateescape.py
@@ -33,6 +33,12 @@ class TestSurrogateEscape(unittest.TestCase):
         b = payload.encode('ascii', 'surrogateescape')
         self.assertEqual(b, b'cMO2c3RhbA\xc3\xa1=\n')
 
+    def test_encode_ascii_unicode(self):
+        """
+        Verify that exceptions are raised properly.
+        """
+        self.assertRaises(UnicodeEncodeError, u'\N{SNOWMAN}'.encode, 'US-ASCII', 'surrogateescape')
+
     @expectedFailurePY2
     def test_encode_ascii_surrogateescape_non_newstr(self):
         """
diff --git a/tests/test_future/test_urllibnet.py b/tests/test_future/test_urllibnet.py
index f5f5987540984447f8421dffd523986ac976f532..f9639bfc4e50c90da4feb136dd3148aed4e14bec 100644
--- a/tests/test_future/test_urllibnet.py
+++ b/tests/test_future/test_urllibnet.py
@@ -109,7 +109,8 @@ class urlopenNetworkTests(unittest.TestCase):
 
     # On Windows, socket handles are not file descriptors; this
     # test can't pass on Windows.
-    @unittest.skipIf(sys.platform in ('win32',), 'not appropriate for Windows')
+    @unittest.skipIf(sys.platform in ('darwin', 'win32',), 'not appropriate for Windows')
+    @unittest.skipIf(utils.PY36_PLUS, 'test not applicable on Python 3.5 and higher')
     @skip26
     def test_fileno(self):
         # Make sure fd returned by fileno is valid.
diff --git a/tests/test_past/test_builtins.py b/tests/test_past/test_builtins.py
index be22b974a560b3e0564e418513a0f96f6f055632..d16978ee42af74cf0001b87071a62fd9343c2a0f 100644
--- a/tests/test_past/test_builtins.py
+++ b/tests/test_past/test_builtins.py
@@ -1768,12 +1768,12 @@ class TestSorted(unittest.TestCase):
 #     #         ("classic int division", DeprecationWarning)):
 #     if True:
 #         run_unittest(*args)
-# 
+#
 # def test_main(verbose=None):
 #     test_classes = (BuiltinTest, TestSorted)
-# 
+#
 #     _run_unittest(*test_classes)
-# 
+#
 #     # verify reference counting
 #     if verbose and hasattr(sys, "gettotalrefcount"):
 #         import gc
diff --git a/tests/test_past/test_olddict.py b/tests/test_past/test_olddict.py
index 4ea2471bc390a2319224b3d23c9fbe6577823bba..9f210608bdde744a93d2a591b6bbcfad06a7469f 100644
--- a/tests/test_past/test_olddict.py
+++ b/tests/test_past/test_olddict.py
@@ -622,7 +622,7 @@ class Py2DictTest(unittest.TestCase):
     #                  'd.update({x2: 2})']:
     #         with self.assertRaises(CustomException):
     #             utils.exec_(stmt, locals())
-    # 
+    #
     # def test_resize1(self):
     #     # Dict resizing bug, found by Jack Jansen in 2.2 CVS development.
     #     # This version got an assert failure in debug build, infinite loop in
diff --git a/tests/test_past/test_translation.py b/tests/test_past/test_translation.py
index bb263695ea951694a57f8216214366186d0def74..2b442d96fb7a297cf2abfe425bbb429ec593c9c9 100644
--- a/tests/test_past/test_translation.py
+++ b/tests/test_past/test_translation.py
@@ -67,7 +67,7 @@ class TestTranslate(unittest.TestCase):
             # print('Hooks removed')
             sys.path.remove(self.tempdir)
         return module
- 
+
     def test_print_statement(self):
         code = """
             print 'Hello from a Python 2-style print statement!'
@@ -82,7 +82,7 @@ class TestTranslate(unittest.TestCase):
         """
         module = self.write_and_import(code, 'execer')
         self.assertEqual(module.x, 7)
-        
+
     def test_div(self):
         code = """
         x = 3 / 2
@@ -173,14 +173,14 @@ class TestTranslate(unittest.TestCase):
         module = self.write_and_import(code, 'py2_exceptions')
         self.assertEqual(module.value, 'string: success!')
 
- 
+
 # class TestFuturizeSimple(CodeHandler):
 #     """
 #     This class contains snippets of Python 2 code (invalid Python 3) and
 #     tests for whether they can be imported correctly from Python 3 with the
 #     import hooks.
 #     """
-# 
+#
 #     @unittest.expectedFailure
 #     def test_problematic_string(self):
 #         """ This string generates a SyntaxError on Python 3 unless it has
@@ -193,7 +193,7 @@ class TestTranslate(unittest.TestCase):
 #         s = r'The folder is "C:\Users"'.
 #         """
 #         self.convert_check(before, after)
-# 
+#
 #     def test_tobytes(self):
 #         """
 #         The --tobytes option converts all UNADORNED string literals 'abcd' to b'abcd'.
@@ -228,7 +228,7 @@ class TestTranslate(unittest.TestCase):
 #         s8 = b"pqrs"
 #         """
 #         self.convert_check(before, after, tobytes=True)
-# 
+#
 #     @unittest.expectedFailure
 #     def test_izip(self):
 #         before = """
@@ -243,7 +243,7 @@ class TestTranslate(unittest.TestCase):
 #             pass
 #         """
 #         self.convert_check(before, after, stages=(1, 2), ignore_imports=False)
-# 
+#
 #     @unittest.expectedFailure
 #     def test_no_unneeded_list_calls(self):
 #         """
@@ -254,14 +254,14 @@ class TestTranslate(unittest.TestCase):
 #             pass
 #         """
 #         self.unchanged(code)
-# 
+#
 #     def test_xrange(self):
 #         code = '''
 #         for i in xrange(10):
 #             pass
 #         '''
 #         self.convert(code)
-#     
+#
 #     @unittest.expectedFailure
 #     def test_source_coding_utf8(self):
 #         """
@@ -275,7 +275,7 @@ class TestTranslate(unittest.TestCase):
 #         icons = [u"◐", u"◓", u"◑", u"◒"]
 #         """
 #         self.unchanged(code)
-# 
+#
 #     def test_exception_syntax(self):
 #         """
 #         Test of whether futurize handles the old-style exception syntax
@@ -293,7 +293,7 @@ class TestTranslate(unittest.TestCase):
 #             val = e.errno
 #         """
 #         self.convert_check(before, after)
-# 
+#
 #     def test_super(self):
 #         """
 #         This tests whether futurize keeps the old two-argument super() calls the
@@ -306,7 +306,7 @@ class TestTranslate(unittest.TestCase):
 #                 super(VerboseList, self).append(item)
 #         '''
 #         self.unchanged(code)
-# 
+#
 #     @unittest.expectedFailure
 #     def test_file(self):
 #         """
@@ -323,41 +323,41 @@ class TestTranslate(unittest.TestCase):
 #         f.close()
 #         '''
 #         self.convert_check(before, after)
-# 
+#
 #     def test_apply(self):
 #         before = '''
 #         def addup(*x):
 #             return sum(x)
-#         
+#
 #         assert apply(addup, (10,20)) == 30
 #         '''
 #         after = """
 #         def addup(*x):
 #             return sum(x)
-#         
+#
 #         assert addup(*(10,20)) == 30
 #         """
 #         self.convert_check(before, after)
-#     
+#
 #     @unittest.skip('not implemented yet')
 #     def test_download_pypi_package_and_test(self, package_name='future'):
 #         URL = 'http://pypi.python.org/pypi/{0}/json'
-#         
+#
 #         import requests
 #         r = requests.get(URL.format(package_name))
 #         pprint.pprint(r.json())
-#         
+#
 #         download_url = r.json()['urls'][0]['url']
 #         filename = r.json()['urls'][0]['filename']
 #         # r2 = requests.get(download_url)
 #         # with open('/tmp/' + filename, 'w') as tarball:
 #         #     tarball.write(r2.content)
-# 
+#
 #     def test_raw_input(self):
 #         """
 #         Passes in a string to the waiting input() after futurize
 #         conversion.
-# 
+#
 #         The code is the first snippet from these docs:
 #             http://docs.python.org/2/library/2to3.html
 #         """
@@ -376,13 +376,13 @@ class TestTranslate(unittest.TestCase):
 #         greet(name)
 #         """
 #         self.convert_check(before, desired, run=False)
-# 
+#
 #         for interpreter in self.interpreters:
 #             p1 = Popen([interpreter, self.tempdir + 'mytestscript.py'],
 #                        stdout=PIPE, stdin=PIPE, stderr=PIPE)
 #             (stdout, stderr) = p1.communicate(b'Ed')
 #             self.assertEqual(stdout, b"What's your name?\nHello, Ed!\n")
-# 
+#
 #     def test_literal_prefixes_are_not_stripped(self):
 #         """
 #         Tests to ensure that the u'' and b'' prefixes on unicode strings and
@@ -397,7 +397,7 @@ class TestTranslate(unittest.TestCase):
 #         b = b'byte string'
 #         '''
 #         self.unchanged(code)
-# 
+#
 #     @unittest.expectedFailure
 #     def test_division(self):
 #         """
@@ -411,8 +411,8 @@ class TestTranslate(unittest.TestCase):
 #         x = old_div(1, 2)
 #         """
 #         self.convert_check(before, after, stages=[1])
-# 
-# 
+#
+#
 # class TestFuturizeRenamedStdlib(CodeHandler):
 #     def test_renamed_modules(self):
 #         before = """
@@ -420,7 +420,7 @@ class TestTranslate(unittest.TestCase):
 #         import copy_reg
 #         import cPickle
 #         import cStringIO
-# 
+#
 #         s = cStringIO.StringIO('blah')
 #         """
 #         after = """
@@ -428,18 +428,18 @@ class TestTranslate(unittest.TestCase):
 #         import copyreg
 #         import pickle
 #         import io
-# 
+#
 #         s = io.StringIO('blah')
 #         """
 #         self.convert_check(before, after)
-#     
+#
 #     @unittest.expectedFailure
 #     def test_urllib_refactor(self):
 #         # Code like this using urllib is refactored by futurize --stage2 to use
 #         # the new Py3 module names, but ``future`` doesn't support urllib yet.
 #         before = """
 #         import urllib
-# 
+#
 #         URL = 'http://pypi.python.org/pypi/future/json'
 #         package_name = 'future'
 #         r = urllib.urlopen(URL.format(package_name))
@@ -447,14 +447,14 @@ class TestTranslate(unittest.TestCase):
 #         """
 #         after = """
 #         import urllib.request
-#         
+#
 #         URL = 'http://pypi.python.org/pypi/future/json'
 #         package_name = 'future'
 #         r = urllib.request.urlopen(URL.format(package_name))
 #         data = r.read()
 #         """
 #         self.convert_check(before, after)
-# 
+#
 #     def test_renamed_copy_reg_and_cPickle_modules(self):
 #         """
 #         Example from docs.python.org/2/library/copy_reg.html
@@ -466,11 +466,11 @@ class TestTranslate(unittest.TestCase):
 #         class C(object):
 #             def __init__(self, a):
 #                 self.a = a
-# 
+#
 #         def pickle_c(c):
 #             print('pickling a C instance...')
 #             return C, (c.a,)
-# 
+#
 #         copy_reg.pickle(C, pickle_c)
 #         c = C(1)
 #         d = copy.copy(c)
@@ -483,23 +483,23 @@ class TestTranslate(unittest.TestCase):
 #         class C(object):
 #             def __init__(self, a):
 #                 self.a = a
-# 
+#
 #         def pickle_c(c):
 #             print('pickling a C instance...')
 #             return C, (c.a,)
-# 
+#
 #         copyreg.pickle(C, pickle_c)
 #         c = C(1)
 #         d = copy.copy(c)
 #         p = pickle.dumps(c)
 #         """
 #         self.convert_check(before, after)
-# 
+#
 #     @unittest.expectedFailure
 #     def test_Py2_StringIO_module(self):
 #         """
 #         Ideally, there would be a fixer for this. For now:
-# 
+#
 #         TODO: add the Py3 equivalent for this to the docs
 #         """
 #         before = """
@@ -515,19 +515,19 @@ class TestTranslate(unittest.TestCase):
 #         # instead?
 #         """
 #         self.convert_check(before, after)
-# 
-# 
+#
+#
 # class TestFuturizeStage1(CodeHandler):
 #     # """
 #     # Tests "stage 1": safe optimizations: modernizing Python 2 code so that it
 #     # uses print functions, new-style exception syntax, etc.
-# 
+#
 #     # The behaviour should not change and this should introduce no dependency on
 #     # the ``future`` package. It produces more modern Python 2-only code. The
 #     # goal is to reduce the size of the real porting patch-set by performing
 #     # the uncontroversial patches first.
 #     # """
-# 
+#
 #     def test_apply(self):
 #         """
 #         apply() should be changed by futurize --stage1
@@ -535,7 +535,7 @@ class TestTranslate(unittest.TestCase):
 #         before = '''
 #         def f(a, b):
 #             return a + b
-# 
+#
 #         args = (1, 2)
 #         assert apply(f, args) == 3
 #         assert apply(f, ('a', 'b')) == 'ab'
@@ -543,13 +543,13 @@ class TestTranslate(unittest.TestCase):
 #         after = '''
 #         def f(a, b):
 #             return a + b
-# 
+#
 #         args = (1, 2)
 #         assert f(*args) == 3
 #         assert f(*('a', 'b')) == 'ab'
 #         '''
 #         self.convert_check(before, after, stages=[1])
-# 
+#
 #     def test_xrange(self):
 #         """
 #         xrange should not be changed by futurize --stage1
@@ -559,18 +559,18 @@ class TestTranslate(unittest.TestCase):
 #             pass
 #         '''
 #         self.unchanged(code, stages=[1])
-# 
+#
 #     @unittest.expectedFailure
 #     def test_absolute_import_changes(self):
 #         """
 #         Implicit relative imports should be converted to absolute or explicit
 #         relative imports correctly.
-# 
+#
 #         Issue #16 (with porting bokeh/bbmodel.py)
 #         """
 #         with open('specialmodels.py', 'w') as f:
 #             f.write('pass')
-# 
+#
 #         before = """
 #         import specialmodels.pandasmodel
 #         specialmodels.pandasmodel.blah()
@@ -581,7 +581,7 @@ class TestTranslate(unittest.TestCase):
 #         pandasmodel.blah()
 #         """
 #         self.convert_check(before, after, stages=[1])
-# 
+#
 #     def test_safe_futurize_imports(self):
 #         """
 #         The standard library module names should not be changed until stage 2
@@ -590,13 +590,13 @@ class TestTranslate(unittest.TestCase):
 #         import ConfigParser
 #         import HTMLParser
 #         import collections
-# 
+#
 #         ConfigParser.ConfigParser
 #         HTMLParser.HTMLParser
 #         d = collections.OrderedDict()
 #         """
 #         self.unchanged(before, stages=[1])
-# 
+#
 #     def test_print(self):
 #         before = """
 #         print 'Hello'
@@ -605,7 +605,7 @@ class TestTranslate(unittest.TestCase):
 #         print('Hello')
 #         """
 #         self.convert_check(before, after, stages=[1])
-# 
+#
 #         before = """
 #         import sys
 #         print >> sys.stderr, 'Hello', 'world'
@@ -615,16 +615,16 @@ class TestTranslate(unittest.TestCase):
 #         print('Hello', 'world', file=sys.stderr)
 #         """
 #         self.convert_check(before, after, stages=[1])
-# 
+#
 #     def test_print_already_function(self):
 #         """
-#         Running futurize --stage1 should not add a second set of parentheses 
+#         Running futurize --stage1 should not add a second set of parentheses
 #         """
 #         before = """
 #         print('Hello')
 #         """
 #         self.unchanged(before, stages=[1])
-# 
+#
 #     @unittest.expectedFailure
 #     def test_print_already_function_complex(self):
 #         """
@@ -639,7 +639,7 @@ class TestTranslate(unittest.TestCase):
 #         print('Hello', 'world', file=sys.stderr)
 #         """
 #         self.unchanged(before, stages=[1])
-# 
+#
 #     def test_exceptions(self):
 #         before = """
 #         try:
@@ -654,7 +654,7 @@ class TestTranslate(unittest.TestCase):
 #             pass
 #         """
 #         self.convert_check(before, after, stages=[1])
-# 
+#
 #     @unittest.expectedFailure
 #     def test_string_exceptions(self):
 #         """
@@ -674,7 +674,7 @@ class TestTranslate(unittest.TestCase):
 #             pass
 #         """
 #         self.convert_check(before, after, stages=[1])
-# 
+#
 #     @unittest.expectedFailure
 #     def test_oldstyle_classes(self):
 #         """
@@ -689,8 +689,8 @@ class TestTranslate(unittest.TestCase):
 #             pass
 #         """
 #         self.convert_check(before, after, stages=[1])
-# 
-#         
+#
+#
 #     def test_octal_literals(self):
 #         before = """
 #         mode = 0644
@@ -699,7 +699,7 @@ class TestTranslate(unittest.TestCase):
 #         mode = 0o644
 #         """
 #         self.convert_check(before, after)
-# 
+#
 #     def test_long_int_literals(self):
 #         before = """
 #         bignumber = 12345678901234567890L
@@ -708,7 +708,7 @@ class TestTranslate(unittest.TestCase):
 #         bignumber = 12345678901234567890
 #         """
 #         self.convert_check(before, after)
-# 
+#
 #     def test___future___import_position(self):
 #         """
 #         Issue #4: __future__ imports inserted too low in file: SyntaxError
@@ -722,13 +722,13 @@ class TestTranslate(unittest.TestCase):
 #         #
 #         # another comment
 #         #
-#         
+#
 #         CONSTANTS = [ 0, 01, 011, 0111, 012, 02, 021, 0211, 02111, 013 ]
 #         _RN_LETTERS = "IVXLCDM"
-#         
+#
 #         def my_func(value):
 #             pass
-#         
+#
 #         ''' Docstring-like comment here '''
 #         """
 #         self.convert(code)
@@ -736,4 +736,3 @@ class TestTranslate(unittest.TestCase):
 
 if __name__ == '__main__':
     unittest.main()
-