More 2to3 fixes in the Tools directory. Fixes #2893.
diff --git a/Tools/unicode/gencodec.py b/Tools/unicode/gencodec.py
index c63f559..c3846e9 100644
--- a/Tools/unicode/gencodec.py
+++ b/Tools/unicode/gencodec.py
@@ -32,7 +32,7 @@
 MAX_TABLE_SIZE = 8192
 
 # Standard undefined Unicode code point
-UNI_UNDEFINED = unichr(0xFFFE)
+UNI_UNDEFINED = chr(0xFFFE)
 
 mapRE = re.compile('((?:0x[0-9a-fA-F]+\+?)+)'
                    '\s+'
@@ -62,7 +62,7 @@
             l[i] = int(l[i],16)
         except ValueError:
             l[i] = None
-    l = filter(lambda x: x is not None, l)
+    l = [x for x in l if x is not None]
     if len(l) == 1:
         return l[0]
     else:
@@ -75,12 +75,12 @@
     f.close()
     enc2uni = {}
     identity = []
-    unmapped = range(256)
+    unmapped = list(range(256))
 
     # UTC mapping tables per convention don't include the identity
     # mappings for code points 0x00 - 0x1F and 0x7F, unless these are
     # explicitly mapped to different characters or undefined
-    for i in range(32) + [127]:
+    for i in list(range(32)) + [127]:
         identity.append(i)
         unmapped.remove(i)
         enc2uni[i] = (i, 'CONTROL CHARACTER')
@@ -138,7 +138,7 @@
 
     l = []
     append = l.append
-    if map.has_key("IDENTITY"):
+    if "IDENTITY" in map:
         append("%s = codecs.make_identity_dict(range(%d))" %
                (varname, map["IDENTITY"]))
         append("%s.update({" % varname)
@@ -150,8 +150,7 @@
         splits = 0
         identity = 0
 
-    mappings = map.items()
-    mappings.sort()
+    mappings = sorted(map.items())
     i = 0
     key_precision, value_precision = precisions
     for mapkey, mapvalue in mappings:
@@ -199,11 +198,10 @@
     append('%s = (' % varname)
 
     # Analyze map and create table dict
-    mappings = map.items()
-    mappings.sort()
+    mappings = sorted(map.items())
     table = {}
     maxkey = 0
-    if map.has_key('IDENTITY'):
+    if 'IDENTITY' in map:
         for key in range(256):
             table[key] = (key, '')
         maxkey = 255
@@ -237,7 +235,7 @@
                 # 1-n mappings not supported
                 return None
             else:
-                mapchar = unichr(mapvalue)
+                mapchar = chr(mapvalue)
         if mapcomment and comments:
             append('    %r\t#  %s -> %s' % (mapchar,
                                             hexrepr(key, key_precision),