diff options
| author | Benjamin Peterson <benjamin@python.org> | 2008-11-10 22:11:12 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2008-11-10 22:11:12 (GMT) |
| commit | ba4d4807767b554444169ede89980df6376d6fe6 (patch) | |
| tree | 987bceccc30fe7fd8737f4a785c0fbf91445b492 /Lib/lib2to3/fixes/fix_imports.py | |
| parent | b7c95ce8b82c1cfce684edfca73aca4e7ae61940 (diff) | |
| download | cpython-ba4d4807767b554444169ede89980df6376d6fe6.zip cpython-ba4d4807767b554444169ede89980df6376d6fe6.tar.gz cpython-ba4d4807767b554444169ede89980df6376d6fe6.tar.bz2 | |
Merged revisions 66985,67170,67173,67177-67179 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r66985 | benjamin.peterson | 2008-10-20 16:43:46 -0500 (Mon, 20 Oct 2008) | 1 line
no need to use nested try, except, finally
........
r67170 | benjamin.peterson | 2008-11-08 12:28:31 -0600 (Sat, 08 Nov 2008) | 1 line
fix #4271: fix_imports didn't recognize imports with parenthesis (ie from x import (a, b))
........
r67173 | benjamin.peterson | 2008-11-08 17:42:08 -0600 (Sat, 08 Nov 2008) | 1 line
consolidate test
........
r67177 | benjamin.peterson | 2008-11-09 21:52:52 -0600 (Sun, 09 Nov 2008) | 1 line
let the metclass fixer handle complex assignments in the class body gracefully
........
r67178 | benjamin.peterson | 2008-11-10 15:26:43 -0600 (Mon, 10 Nov 2008) | 1 line
the metaclass fixers shouldn't die when bases are not a simple name
........
r67179 | benjamin.peterson | 2008-11-10 15:29:58 -0600 (Mon, 10 Nov 2008) | 1 line
allow the fix_import pattern to catch from imports with parenthesis
........
Diffstat (limited to 'Lib/lib2to3/fixes/fix_imports.py')
| -rw-r--r-- | Lib/lib2to3/fixes/fix_imports.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/lib2to3/fixes/fix_imports.py b/Lib/lib2to3/fixes/fix_imports.py index e7e7a75..38e868b 100644 --- a/Lib/lib2to3/fixes/fix_imports.py +++ b/Lib/lib2to3/fixes/fix_imports.py @@ -66,9 +66,9 @@ def build_pattern(mapping=MAPPING): yield """import_name< 'import' ((%s) | dotted_as_names< any* (%s) any* >) > """ % (mod_list, mod_list) - yield """import_from< 'from' (%s) 'import' + yield """import_from< 'from' (%s) 'import' ['('] ( any | import_as_name< any 'as' any > | - import_as_names< any* >) > + import_as_names< any* >) [')'] > """ % mod_name_list yield """import_name< 'import' dotted_as_name< (%s) 'as' any > > |
