Convert except X,T to except X as T
Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
6b8ee4a183
commit
c327bec6c8
@ -79,19 +79,19 @@ class UsefulIMAPMixIn(object):
|
|||||||
try:
|
try:
|
||||||
# use socket of our own, possiblly socksified socket.
|
# use socket of our own, possiblly socksified socket.
|
||||||
s = self.socket(af, socktype, proto)
|
s = self.socket(af, socktype, proto)
|
||||||
except socket.error, msg:
|
except socket.error as msg:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
for i in (0, 1):
|
for i in (0, 1):
|
||||||
try:
|
try:
|
||||||
s.connect(sa)
|
s.connect(sa)
|
||||||
break
|
break
|
||||||
except socket.error, msg:
|
except socket.error as msg:
|
||||||
if len(msg.args) < 2 or msg.args[0] != errno.EINTR:
|
if len(msg.args) < 2 or msg.args[0] != errno.EINTR:
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
raise socket.error(msg)
|
raise socket.error(msg)
|
||||||
except socket.error, msg:
|
except socket.error as msg:
|
||||||
s.close()
|
s.close()
|
||||||
continue
|
continue
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user