Run 2to3 on this library.
diff --git a/Lib/lib2to3/fixes/basefix.py b/Lib/lib2to3/fixes/basefix.py
index 66c448e..38666c1 100644
--- a/Lib/lib2to3/fixes/basefix.py
+++ b/Lib/lib2to3/fixes/basefix.py
@@ -108,7 +108,7 @@
         """
         name = template
         while name in self.used_names:
-            name = template + str(self.numbers.next())
+            name = template + str(next(self.numbers))
         self.used_names.add(name)
         return name
 
diff --git a/Lib/lib2to3/fixes/fix_imports.py b/Lib/lib2to3/fixes/fix_imports.py
index fbdf7e4..9aba984 100644
--- a/Lib/lib2to3/fixes/fix_imports.py
+++ b/Lib/lib2to3/fixes/fix_imports.py
@@ -10,8 +10,8 @@
 # Local imports
 from . import basefix
 from .util import Name, attr_chain, any, set
-import __builtin__
-builtin_names = [name for name in dir(__builtin__)
+import builtins
+builtin_names = [name for name in dir(builtins)
                  if name not in ("__name__", "__doc__")]
 
 MAPPING = {"StringIO":  ("io", ["StringIO"]),
@@ -26,7 +26,7 @@
 
 def build_pattern():
     bare = set()
-    for old_module, (new_module, members) in MAPPING.items():
+    for old_module, (new_module, members) in list(MAPPING.items()):
         bare.add(old_module)
         bare.update(members)
         members = alternates(members)
diff --git a/Lib/lib2to3/fixes/fix_renames.py b/Lib/lib2to3/fixes/fix_renames.py
index 58ad6ce..0b2bbf5 100644
--- a/Lib/lib2to3/fixes/fix_renames.py
+++ b/Lib/lib2to3/fixes/fix_renames.py
@@ -20,8 +20,8 @@
 
 def build_pattern():
     #bare = set()
-    for module, replace in MAPPING.items():
-        for old_attr, new_attr in replace.items():
+    for module, replace in list(MAPPING.items()):
+        for old_attr, new_attr in list(replace.items()):
             LOOKUP[(module, old_attr)] = new_attr
             #bare.add(module)
             #bare.add(old_attr)
diff --git a/Lib/lib2to3/fixes/util.py b/Lib/lib2to3/fixes/util.py
index ef809af..806bf28 100644
--- a/Lib/lib2to3/fixes/util.py
+++ b/Lib/lib2to3/fixes/util.py
@@ -323,7 +323,7 @@
     elif node.type == syms.import_from:
         # unicode(...) is used to make life easier here, because
         # from a.b import parses to ['import', ['a', '.', 'b'], ...]
-        if package and unicode(node.children[1]).strip() != package:
+        if package and str(node.children[1]).strip() != package:
             return None
         n = node.children[3]
         if package and _find('as', n):