Convert print statements to function calls in Tools/.
diff --git a/Tools/msi/msi.py b/Tools/msi/msi.py
index c49bb84..93c6ba7 100644
--- a/Tools/msi/msi.py
+++ b/Tools/msi/msi.py
@@ -114,7 +114,7 @@
     dlltool = find_executable('dlltool')
 
     if not nm or not dlltool:
-        print warning % "nm and/or dlltool were not found"
+        print(warning % "nm and/or dlltool were not found")
         return False
 
     nm_command = '%s -Cs %s' % (nm, lib_file)
@@ -123,23 +123,23 @@
     export_match = re.compile(r"^_imp__(.*) in python\d+\.dll").match
 
     f = open(def_file,'w')
-    print >>f, "LIBRARY %s" % dll_file
-    print >>f, "EXPORTS"
+    print("LIBRARY %s" % dll_file, file=f)
+    print("EXPORTS", file=f)
 
     nm_pipe = os.popen(nm_command)
     for line in nm_pipe.readlines():
         m = export_match(line)
         if m:
-            print >>f, m.group(1)
+            print(m.group(1), file=f)
     f.close()
     exit = nm_pipe.close()
 
     if exit:
-        print warning % "nm did not run successfully"
+        print(warning % "nm did not run successfully")
         return False
 
     if os.system(dlltool_command) != 0:
-        print warning % "dlltool did not run successfully"
+        print(warning % "dlltool did not run successfully")
         return False
 
     return True
@@ -875,7 +875,7 @@
     # Check if _ctypes.pyd exists
     have_ctypes = os.path.exists(srcdir+"/PCBuild/_ctypes.pyd")
     if not have_ctypes:
-        print "WARNING: _ctypes.pyd not found, ctypes will not be included"
+        print("WARNING: _ctypes.pyd not found, ctypes will not be included")
         extensions.remove("_ctypes.pyd")
 
     # Add all .py files in Lib, except lib-tk, test
@@ -953,7 +953,7 @@
                 if f.endswith(".au") or f.endswith(".gif"):
                     lib.add_file(f)
                 else:
-                    print "WARNING: New file %s in email/test/data" % f
+                    print("WARNING: New file %s in email/test/data" % f)
         for f in os.listdir(lib.absolute):
             if os.path.isdir(os.path.join(lib.absolute, f)):
                 pydirs.append((lib, f))
@@ -968,7 +968,7 @@
         if f=="_tkinter.pyd":
             continue
         if not os.path.exists(srcdir+"/PCBuild/"+f):
-            print "WARNING: Missing extension", f
+            print("WARNING: Missing extension", f)
             continue
         dlls.append(f)
         lib.add_file(f)
@@ -982,7 +982,7 @@
     lib.add_file(srcdir+"/"+sqlite_dir+sqlite_arch+"/sqlite3.dll")
     if have_tcl:
         if not os.path.exists(srcdir+"/PCBuild/_tkinter.pyd"):
-            print "WARNING: Missing _tkinter.pyd"
+            print("WARNING: Missing _tkinter.pyd")
         else:
             lib.start_component("TkDLLs", tcltk)
             lib.add_file("_tkinter.pyd")
@@ -994,7 +994,7 @@
     for f in glob.glob1(srcdir+"/PCBuild", "*.pyd"):
         if f.endswith("_d.pyd"): continue # debug version
         if f in dlls: continue
-        print "WARNING: Unknown extension", f
+        print("WARNING: Unknown extension", f)
 
     # Add headers
     default_feature.set_current()
diff --git a/Tools/msi/msilib.py b/Tools/msi/msilib.py
index 548b640..8aea216 100644
--- a/Tools/msi/msilib.py
+++ b/Tools/msi/msilib.py
@@ -95,7 +95,7 @@
             index -= 1
             unk = type & ~knownbits
             if unk:
-                print "%s.%s unknown bits %x" % (self.name, name, unk)
+                print("%s.%s unknown bits %x" % (self.name, name, unk))
             size = type & datasizemask
             dtype = type & typemask
             if dtype == type_string:
@@ -114,7 +114,7 @@
                 tname="OBJECT"
             else:
                 tname="unknown"
-                print "%s.%sunknown integer type %d" % (self.name, name, size)
+                print("%s.%sunknown integer type %d" % (self.name, name, size))
             if type & type_nullable:
                 flags = ""
             else:
@@ -202,7 +202,7 @@
     v = seqmsi.OpenView("SELECT * FROM _Tables");
     v.Execute(None)
     f = open(destpath, "w")
-    print >>f, "import msilib,os;dirname=os.path.dirname(__file__)"
+    print("import msilib,os;dirname=os.path.dirname(__file__)", file=f)
     tables = []
     while 1:
         r = v.Fetch()
@@ -364,9 +364,9 @@
             logical = self.gen_id(dir, file)
         self.index += 1
         if full.find(" ")!=-1:
-            print >>self.file, '"%s" %s' % (full, logical)
+            print('"%s" %s' % (full, logical), file=self.file)
         else:
-            print >>self.file, '%s %s' % (full, logical)
+            print('%s %s' % (full, logical), file=self.file)
         return self.index, logical
 
     def commit(self, db):
@@ -386,7 +386,7 @@
             if not os.path.exists(cabarc):continue
             break
         else:
-            print "WARNING: cabarc.exe not found in registry"
+            print("WARNING: cabarc.exe not found in registry")
             cabarc = "cabarc.exe"
         cmd = r'"%s" -m lzx:21 n %s.cab @%s.txt' % (cabarc, self.name, self.name)
         p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,