Merge "Fix try/except syntax for Python 3"

This commit is contained in:
Jenkins 2014-01-11 07:36:30 +00:00 committed by Gerrit Code Review
commit 0fd4923e2f

View File

@ -530,7 +530,9 @@ class Connection(object):
try:
self._connect(params)
return
except (IOError, self.connection_errors) as e:
except IOError:
pass
except self.connection_errors:
pass
except Exception as e:
# NOTE(comstud): Unfortunately it's possible for amqplib
@ -571,7 +573,10 @@ class Connection(object):
while True:
try:
return method(*args, **kwargs)
except (self.connection_errors, socket.timeout, IOError) as e:
except self.connection_errors as e:
if error_callback:
error_callback(e)
except (socket.timeout, IOError) as e:
if error_callback:
error_callback(e)
except Exception as e: