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/Demo/scripts/eqfix.py b/Demo/scripts/eqfix.py
index 35c43aa..497ab20 100755
--- a/Demo/scripts/eqfix.py
+++ b/Demo/scripts/eqfix.py
@@ -62,7 +62,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()
@@ -83,7 +83,7 @@
 ##      dbg('fix(%r)\n' % (dirname,))
     try:
         f = open(filename, 'r')
-    except IOError, msg:
+    except IOError as msg:
         err('%s: cannot open: %r\n' % (filename, msg))
         return 1
     head, tail = os.path.split(filename)
@@ -120,7 +120,7 @@
             if g is None:
                 try:
                     g = open(tempname, 'w')
-                except IOError, msg:
+                except IOError as msg:
                     f.close()
                     err('%s: cannot create: %r\n' % (tempname, msg))
                     return 1
@@ -144,17 +144,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
diff --git a/Demo/scripts/ftpstats.py b/Demo/scripts/ftpstats.py
index 5c1599e..c7c0749 100755
--- a/Demo/scripts/ftpstats.py
+++ b/Demo/scripts/ftpstats.py
@@ -25,7 +25,7 @@
     search = None
     try:
         opts, args = getopt.getopt(sys.argv[1:], 'm:s:')
-    except getopt.error, msg:
+    except getopt.error as msg:
         print msg
         print 'usage: ftpstats [-m maxitems] [file]'
         sys.exit(2)
@@ -41,7 +41,7 @@
     else:
         try:
             f = open(file, 'r')
-        except IOError, msg:
+        except IOError as msg:
             print file, ':', msg
             sys.exit(1)
     bydate = {}
diff --git a/Demo/scripts/mboxconvert.py b/Demo/scripts/mboxconvert.py
index 8c462f3..8da37bf 100755
--- a/Demo/scripts/mboxconvert.py
+++ b/Demo/scripts/mboxconvert.py
@@ -16,7 +16,7 @@
     dofile = mmdf
     try:
         opts, args = getopt.getopt(sys.argv[1:], 'f')
-    except getopt.error, msg:
+    except getopt.error as msg:
         sys.stderr.write('%s\n' % msg)
         sys.exit(2)
     for o, a in opts:
@@ -33,7 +33,7 @@
         elif os.path.isfile(arg):
             try:
                 f = open(arg)
-            except IOError, msg:
+            except IOError as msg:
                 sys.stderr.write('%s: %s\n' % (arg, msg))
                 sts = 1
                 continue
@@ -56,7 +56,7 @@
         fn = os.path.join(dir, msg)
         try:
             f = open(fn)
-        except IOError, msg:
+        except IOError as msg:
             sys.stderr.write('%s: %s\n' % (fn, msg))
             sts = 1
             continue
diff --git a/Demo/scripts/newslist.py b/Demo/scripts/newslist.py
index a631214..0111ace 100755
--- a/Demo/scripts/newslist.py
+++ b/Demo/scripts/newslist.py
@@ -330,7 +330,7 @@
         else:
             s = NNTP(newshost)
         connected = 1
-    except (nntplib.error_temp, nntplib.error_perm), x:
+    except (nntplib.error_temp, nntplib.error_perm) as x:
         print 'Error connecting to host:', x
         print 'I\'ll try to use just the local list.'
         connected = 0
diff --git a/Demo/scripts/pp.py b/Demo/scripts/pp.py
index 0491fa9..2530ea3 100755
--- a/Demo/scripts/pp.py
+++ b/Demo/scripts/pp.py
@@ -35,7 +35,7 @@
 
 try:
     optlist, ARGS = getopt.getopt(sys.argv[1:], 'acde:F:np')
-except getopt.error, msg:
+except getopt.error as msg:
     sys.stderr.write(sys.argv[0] + ': ' + msg + '\n')
     sys.exit(2)
 
diff --git a/Demo/scripts/update.py b/Demo/scripts/update.py
index eac1a22..a965e4a 100755
--- a/Demo/scripts/update.py
+++ b/Demo/scripts/update.py
@@ -19,7 +19,7 @@
         self.changed = 0
         try:
             self.lines = open(filename, 'r').readlines()
-        except IOError, msg:
+        except IOError as msg:
             print '*** Can\'t open "%s":' % filename, msg
             self.lines = None
             return
@@ -32,7 +32,7 @@
         try:
             os.rename(self.filename, self.filename + '~')
             fp = open(self.filename, 'w')
-        except (os.error, IOError), msg:
+        except (os.error, IOError) as msg:
             print '*** Can\'t rewrite "%s":' % self.filename, msg
             return
         print 'writing', self.filename
@@ -67,7 +67,7 @@
     if sys.argv[1:]:
         try:
             fp = open(sys.argv[1], 'r')
-        except IOError, msg:
+        except IOError as msg:
             print 'Can\'t open "%s":' % sys.argv[1], msg
             sys.exit(1)
     else: