Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index c7ebce8..0b62ea6 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -54,7 +54,7 @@
         if 'PY_VERSION' in ln:
             return ln.split()[-1][1:-1]
 
-    raise RuntimeError, "Cannot find full version??"
+    raise RuntimeError("Cannot find full version??")
 
 # The directory we'll use to create the build (will be erased and recreated)
 WORKDIR = "/tmp/_py"
@@ -291,7 +291,7 @@
     xit = fd.close()
     if xit != None:
         sys.stdout.write(data)
-        raise RuntimeError, "command failed: %s"%(commandline,)
+        raise RuntimeError("command failed: %s"%(commandline,))
 
     if VERBOSE:
         sys.stdout.write(data); sys.stdout.flush()
@@ -302,7 +302,7 @@
     xit = fd.close()
     if xit != None:
         sys.stdout.write(data)
-        raise RuntimeError, "command failed: %s"%(commandline,)
+        raise RuntimeError("command failed: %s"%(commandline,))
 
     return data
 
@@ -361,7 +361,7 @@
             SRCDIR=v
 
         else:
-            raise NotImplementedError, k
+            raise NotImplementedError(k)
 
     SRCDIR=os.path.abspath(SRCDIR)
     WORKDIR=os.path.abspath(WORKDIR)
@@ -418,7 +418,7 @@
         xit = fp.close()
         if xit is not None:
             sys.stdout.write(data)
-            raise RuntimeError, "Cannot extract %s"%(archiveName,)
+            raise RuntimeError("Cannot extract %s"%(archiveName,))
 
         return os.path.join(builddir, retval)
 
diff --git a/Mac/Tools/Doc/setup.py b/Mac/Tools/Doc/setup.py
index 5f60c51..e1d8fb1 100644
--- a/Mac/Tools/Doc/setup.py
+++ b/Mac/Tools/Doc/setup.py
@@ -59,7 +59,7 @@
         dirname = 'Python-Docs-%s' % self.doc_version
 
         if os.path.exists(self.build_html):
-            raise RuntimeError, '%s: already exists, please remove and try again' % self.build_html
+            raise RuntimeError('%s: already exists, please remove and try again' % self.build_html)
         os.chdir(self.build_base)
         self.spawn('curl','-O', url)
         self.spawn('tar', '-xjf', tarfile)
@@ -146,8 +146,7 @@
         self.mkpath(self.build_base)
         self.ensureHtml()
         if not os.path.isdir(self.build_html):
-            raise RuntimeError, \
-            "Can't find source folder for documentation."
+            raise RuntimeError("Can't find source folder for documentation.")
         self.mkpath(self.build_dest)
         if dep_util.newer(os.path.join(self.build_html,'index.html'), os.path.join(self.build_dest,'index.html')):
             self.mkpath(self.build_dest)
diff --git a/Mac/scripts/buildpkg.py b/Mac/scripts/buildpkg.py
index 73dd4b6..ad0afe4 100644
--- a/Mac/scripts/buildpkg.py
+++ b/Mac/scripts/buildpkg.py
@@ -194,7 +194,7 @@
             if k in fields:
                 self.packageInfo[k] = v
             elif not k in ["OutputDir"]:
-                raise Error, "Unknown package option: %s" % k
+                raise Error("Unknown package option: %s" % k)
 
         # Check where we should leave the output. Default is current directory
         outputdir = options.get("OutputDir", os.getcwd())
diff --git a/Mac/scripts/mkestrres.py b/Mac/scripts/mkestrres.py
index d423892..93af56e 100644
--- a/Mac/scripts/mkestrres.py
+++ b/Mac/scripts/mkestrres.py
@@ -33,7 +33,7 @@
 
 def Pstring(str):
     if len(str) > 255:
-        raise ValueError, 'String too large'
+        raise ValueError('String too large')
     return chr(len(str))+str
 
 def writeestr(dst, edict):