Message112095
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 = {} |
|
| Date |
User |
Action |
Args |
| 2010-07-30 18:19:15 | belopolsky | set | recipients:
+ belopolsky |
| 2010-07-30 18:19:15 | belopolsky | set | messageid: <[email protected]> |
| 2010-07-30 18:19:13 | belopolsky | link | issue9429 messages |
| 2010-07-30 18:19:13 | belopolsky | create | |
|