summaryrefslogtreecommitdiff
path: root/Lib/imaplib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-01-10 16:19:56 +0000
committerGuido van Rossum <guido@python.org>2007-01-10 16:19:56 +0000
commitb940e113bf90ff71b0ef57414ea2beea9d2a4bc0 (patch)
tree0b9ea19eba1e665dac95126c3140ac2bc36326ad /Lib/imaplib.py
parent893523e80a2003d4a630aafb84ba016e0070cbbd (diff)
downloadcpython-git-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.gz
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/imaplib.py')
-rw-r--r--Lib/imaplib.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index 08e15207a4..11e262ed50 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -845,7 +845,7 @@ class IMAP4:
try:
self.send('%s%s' % (data, CRLF))
- except (socket.error, OSError), val:
+ except (socket.error, OSError) as val:
raise self.abort('socket error: %s' % val)
if literal is None:
@@ -870,7 +870,7 @@ class IMAP4:
try:
self.send(literal)
self.send(CRLF)
- except (socket.error, OSError), val:
+ except (socket.error, OSError) as val:
raise self.abort('socket error: %s' % val)
if not literator:
@@ -883,9 +883,9 @@ class IMAP4:
self._check_bye()
try:
typ, data = self._get_tagged_response(tag)
- except self.abort, val:
+ except self.abort as val:
raise self.abort('command: %s => %s' % (name, val))
- except self.error, val:
+ except self.error as val:
raise self.error('command: %s => %s' % (name, val))
self._check_bye()
if typ == 'BAD':
@@ -984,7 +984,7 @@ class IMAP4:
try:
self._get_response()
- except self.abort, val:
+ except self.abort as val:
if __debug__:
if self.debug >= 1:
self.print_log()
@@ -1402,7 +1402,7 @@ if __name__ == '__main__':
try:
optlist, args = getopt.getopt(sys.argv[1:], 'd:s:')
- except getopt.error, val:
+ except getopt.error as val:
optlist, args = (), ()
stream_command = None