Issue 9429: 2to3 does not rename test.test_support to test.support
Even though test.support is an internal module, it is helpful to have a 2to3 fixer for the 'test_support' to 'support' rename. My naive attempt to add a fix (see patch pasted below), worked for "from test import test_support" but not for "import test.test_support. Index: Lib/lib2to3/fixes/fix_imports.py =================================================================== --- Lib/lib2to3/fixes/fix_imports.py (revision 83283) +++ Lib/lib2to3/fixes/fix_imports.py (working copy) @@ -55,6 +55,7 @@ 'UserList' : 'collections', 'urlparse' : 'urllib.parse', 'robotparser' : 'urllib.robotparser', + 'test.test_support' : 'test.support', } Index: Lib/lib2to3/fixes/fix_renames.py =================================================================== --- Lib/lib2to3/fixes/fix_renames.py (revision 83283) +++ Lib/lib2to3/fixes/fix_renames.py (working copy) @@ -11,6 +11,7 @@ from ..fixer_util import Name, attr_chain MAPPING = {"sys": {"maxint" : "maxsize"}, + "test": {"test_support": "support"}, } LOOKUP = {}