|
1 | 1 | """Fix changes imports of urllib which are now incompatible. |
2 | | - This is a copy of Lib/lib2to3/fixes/fix_urllib.py, but modified to point to the |
3 | | - six.moves locations for new libraries instead of the Python 3 locations. |
| 2 | +This is a copy of Lib/lib2to3/fixes/fix_urllib.py, but modified to point to the |
| 3 | +six.moves locations for new libraries instead of the Python 3 locations. |
4 | 4 | """ |
| 5 | + |
5 | 6 | # This is a derived work of Lib/lib2to3/fixes/fix_urllib.py. That file |
6 | 7 | # is under the copyright of the Python Software Foundation and licensed |
7 | 8 | # under the Python Software Foundation License 2. |
@@ -110,25 +111,19 @@ def build_pattern(): |
110 | 111 | members = alternates(members) |
111 | 112 | yield """import_name< 'import' (module={!r} |
112 | 113 | | dotted_as_names< any* module={!r} any* >) > |
113 | | - """.format( |
114 | | - old_module, old_module |
115 | | - ) |
| 114 | + """.format(old_module, old_module) |
116 | 115 | yield """import_from< 'from' mod_member={!r} 'import' |
117 | 116 | ( member={} | import_as_name< member={} 'as' any > | |
118 | 117 | import_as_names< members=any* >) > |
119 | | - """.format( |
120 | | - old_module, members, members |
121 | | - ) |
| 118 | + """.format(old_module, members, members) |
122 | 119 | yield """import_from< 'from' module_star=%r 'import' star='*' > |
123 | 120 | """ % old_module |
124 | 121 | yield """import_name< 'import' |
125 | 122 | dotted_as_name< module_as=%r 'as' any > > |
126 | 123 | """ % old_module |
127 | 124 | # bare_with_attr has a special significance for FixImports.match(). |
128 | 125 | yield """power< bare_with_attr={!r} trailer< '.' member={} > any* > |
129 | | - """.format( |
130 | | - old_module, members |
131 | | - ) |
| 126 | + """.format(old_module, members) |
132 | 127 |
|
133 | 128 |
|
134 | 129 | class FixUrllibSix(FixImports): |
|
0 commit comments