[Python-checkins] r63252 - sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py
alexandre.vassalotti
python-checkins at python.org
Thu May 15 01:10:20 CEST 2008
Author: alexandre.vassalotti
Date: Thu May 15 01:10:20 2008
New Revision: 63252
Log:
Added fixer for ConfigParser rename.
Modified:
sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py
Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py (original)
+++ sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Thu May 15 01:10:20 2008
@@ -14,6 +14,9 @@
builtin_names = [name for name in dir(__builtin__)
if name not in ("__name__", "__doc__")]
+# XXX(alexandre): It would be possible to get the modules exports by fetching
+# XXX: their __all__ attribute. However, I fear that this would add an additional
+# XXX: overhead to the fixer.
MAPPING = {"StringIO": ("io", ["StringIO"]),
"cStringIO": ("io", ["StringIO"]),
"__builtin__" : ("builtins", builtin_names),
@@ -32,7 +35,16 @@
'DatagramRequestHandler', 'ThreadingMixIn',
'ForkingMixIn', 'UnixStreamServer',
'UnixDatagramServer', 'ThreadingUnixStreamServer',
- 'ThreadingUnixDatagramServer'])
+ 'ThreadingUnixDatagramServer']),
+ 'ConfigParser': ('configparser',
+ ['NoSectionError', 'DuplicateSectionError',
+ 'NoOptionError', 'InterpolationError',
+ 'InterpolationDepthError',
+ 'InterpolationSyntaxError',
+ 'ParsingError', 'MissingSectionHeaderError',
+ 'ConfigParser', 'SafeConfigParser',
+ 'RawConfigParser', 'DEFAULTSECT',
+ 'MAX_INTERPOLATION_DEPTH'])
}
More information about the Python-checkins
mailing list