Anonymous avatar 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)
         
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.