SF patch 1631942 by Collin Winter:
(a) "except E, V" -> "except E as V"
(b) V is now limited to a simple name (local variable)
(c) V is now deleted at the end of the except block
diff --git a/Tools/scripts/pathfix.py b/Tools/scripts/pathfix.py
index 7f6f191..c59c0f2 100755
--- a/Tools/scripts/pathfix.py
+++ b/Tools/scripts/pathfix.py
@@ -37,7 +37,7 @@
              sys.argv[0])
     try:
         opts, args = getopt.getopt(sys.argv[1:], 'i:')
-    except getopt.error, msg:
+    except getopt.error as msg:
         err(msg + '\n')
         err(usage)
         sys.exit(2)
@@ -68,7 +68,7 @@
     bad = 0
     try:
         names = os.listdir(dirname)
-    except os.error, msg:
+    except os.error as msg:
         err('%s: cannot list directory: %r\n' % (dirname, msg))
         return 1
     names.sort()
@@ -89,7 +89,7 @@
 ##  dbg('fix(%r)\n' % (filename,))
     try:
         f = open(filename, 'r')
-    except IOError, msg:
+    except IOError as msg:
         err('%s: cannot open: %r\n' % (filename, msg))
         return 1
     line = f.readline()
@@ -102,7 +102,7 @@
     tempname = os.path.join(head, '@' + tail)
     try:
         g = open(tempname, 'w')
-    except IOError, msg:
+    except IOError as msg:
         f.close()
         err('%s: cannot create: %r\n' % (tempname, msg))
         return 1
@@ -122,17 +122,17 @@
     try:
         statbuf = os.stat(filename)
         os.chmod(tempname, statbuf[ST_MODE] & 07777)
-    except os.error, msg:
+    except os.error as msg:
         err('%s: warning: chmod failed (%r)\n' % (tempname, msg))
     # Then make a backup of the original file as filename~
     try:
         os.rename(filename, filename + '~')
-    except os.error, msg:
+    except os.error as msg:
         err('%s: warning: backup failed (%r)\n' % (filename, msg))
     # Now move the temp file to the original file
     try:
         os.rename(tempname, filename)
-    except os.error, msg:
+    except os.error as msg:
         err('%s: rename failed (%r)\n' % (filename, msg))
         return 1
     # Return succes