diff options
author | Dirk Mueller <dirk@dmllr.de> | 2013-04-22 03:42:48 +0200 |
---|---|---|
committer | Dirk Mueller <dirk@dmllr.de> | 2013-04-22 03:42:48 +0200 |
commit | 120ddeff7e1b8956fe35a7a39fae87ddcac8301c (patch) | |
tree | b4eb9b278beca16004e6b1825d8173783390540a /openstack/common/rpc/impl_kombu.py | |
parent | 67767b3e8074e4b4a218d7649ef2297c124c342f (diff) | |
download | oslo-120ddeff7e1b8956fe35a7a39fae87ddcac8301c.tar.gz oslo-120ddeff7e1b8956fe35a7a39fae87ddcac8301c.tar.xz oslo-120ddeff7e1b8956fe35a7a39fae87ddcac8301c.zip |
Improve Python 3.x compatibility
Mechanical translation of deprecated constructs
to 3.x compatible variants.
Change-Id: I4988d0ac656903e0d0320aaa8361d4eeb774a0f9
Diffstat (limited to 'openstack/common/rpc/impl_kombu.py')
-rw-r--r-- | openstack/common/rpc/impl_kombu.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/openstack/common/rpc/impl_kombu.py b/openstack/common/rpc/impl_kombu.py index 18cb0d0..0648e4b 100644 --- a/openstack/common/rpc/impl_kombu.py +++ b/openstack/common/rpc/impl_kombu.py @@ -176,7 +176,7 @@ class ConsumerBase(object): """Cancel the consuming from the queue, if it has started""" try: self.queue.cancel(self.tag) - except KeyError, e: + except KeyError as e: # NOTE(comstud): Kludge to get around a amqplib bug if str(e) != "u'%s'" % self.tag: raise @@ -520,7 +520,7 @@ class Connection(object): return except (IOError, self.connection_errors) as e: pass - except Exception, e: + except Exception as e: # NOTE(comstud): Unfortunately it's possible for amqplib # to return an error not covered by its transport # connection_errors in the case of a timeout waiting for @@ -561,10 +561,10 @@ class Connection(object): while True: try: return method(*args, **kwargs) - except (self.connection_errors, socket.timeout, IOError), e: + except (self.connection_errors, socket.timeout, IOError) as e: if error_callback: error_callback(e) - except Exception, e: + except Exception as e: # NOTE(comstud): Unfortunately it's possible for amqplib # to return an error not covered by its transport # connection_errors in the case of a timeout waiting for |