This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: 2to3 does not rename test.test_support to test.support
Type: behavior Stage: needs patch
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.2
process
Status: closed Resolution: duplicate
Dependencies: Superseder: 2to3 fails to fix test.test_support
View: 6583
Assigned To: benjamin.peterson Nosy List: belopolsky, benjamin.peterson, flox
Priority: normal Keywords:

Created on 2010-07-30 18:19 by belopolsky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg112095 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-07-30 18:19
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 = {}
msg112144 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-07-31 11:48
See #6583.
History
Date User Action Args
2022-04-11 14:57:04adminsetgithub: 53675
2010-07-31 11:48:26floxsetstatus: open -> closed

nosy: + flox
messages: + msg112144

superseder: 2to3 fails to fix test.test_support
resolution: duplicate
2010-07-31 11:45:08georg.brandlsetassignee: benjamin.peterson

nosy: + benjamin.peterson
2010-07-30 18:19:13belopolskycreate