Commits

Anonymous committed 63a5dcd

Fixed a bug in the parse string and the order of the test

Comments (0)

Files changed (2)

lib3to2/fixes/fix_imports.py

 # helps match 'client.HTTPConnection', if 'client' has been imported from http
 power_subname_match = "power< {fmt_attr} any* >"
 # helps match 'from http.client import HTTPConnection'
-from_import_match = "from_import=import_from< 'from' {fmt_name} 'import' ['('] imported=any [')]>"
+from_import_match = "from_import=import_from< 'from' {fmt_name} 'import' ['('] imported=any [')'] >"
 # helps match 'from http import client'
 from_import_submod_match = "from_import_submod=import_from< 'from' {fmt_name} 'import' ({fmt_attr} | import_as_name< {fmt_attr} 'as' renamed=any > | import_as_names< any* ({fmt_attr} | import_as_name< {fmt_attr} 'as' renamed=any >) any* > ) >"
 # helps match 'import urllib.request'

lib3to2/tests/test_imports.py

         a = "from __builtin__ import open"
         self.check(b, a)
         
-        b = """from SocketServer import (ThreadingUDPServer, DatagramRequestHandler,
+        b = """from socketserver import (ThreadingUDPServer, DatagramRequestHandler,
                           ThreadingTCPServer, StreamRequestHandler)"""
-        a = """from socketserver import (ThreadingUDPServer, DatagramRequestHandler,
+        a = """from SocketServer import (ThreadingUDPServer, DatagramRequestHandler,
                           ThreadingTCPServer, StreamRequestHandler)"""
         self.check(b, a)