diff options
author | Guido van Rossum <guido@python.org> | 2007-01-10 16:19:56 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-01-10 16:19:56 (GMT) |
commit | b940e113bf90ff71b0ef57414ea2beea9d2a4bc0 (patch) | |
tree | 0b9ea19eba1e665dac95126c3140ac2bc36326ad /Lib/mhlib.py | |
parent | 893523e80a2003d4a630aafb84ba016e0070cbbd (diff) | |
download | cpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.zip cpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.gz cpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.bz2 |
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
Diffstat (limited to 'Lib/mhlib.py')
-rw-r--r-- | Lib/mhlib.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/mhlib.py b/Lib/mhlib.py index 1a90375..8ae6bad 100644 --- a/Lib/mhlib.py +++ b/Lib/mhlib.py @@ -370,7 +370,7 @@ class Folder: count = len(all) try: anchor = self._parseindex(head, all) - except Error, msg: + except Error as msg: seqs = self.getsequences() if not head in seqs: if not msg: @@ -407,7 +407,7 @@ class Folder: # Neither X:Y nor X-Y; must be a number or a (pseudo-)sequence try: n = self._parseindex(seq, all) - except Error, msg: + except Error as msg: seqs = self.getsequences() if not seq in seqs: if not msg: @@ -471,7 +471,7 @@ class Folder: pass try: os.rename(path, commapath) - except os.error, msg: + except os.error as msg: errors.append(msg) else: deleted.append(n) @@ -499,7 +499,7 @@ class Folder: try: shutil.copy2(path, topath) os.unlink(path) - except (IOError, os.error), msg: + except (IOError, os.error) as msg: errors.append(msg) try: os.unlink(topath) @@ -989,7 +989,7 @@ def test(): 'all'): try: do('f.parsesequence(%r)' % (seq,)) - except Error, msg: + except Error as msg: print "Error:", msg stuff = os.popen("pick %r 2>/dev/null" % (seq,)).read() list = map(int, stuff.split()) |