Author: justi9
Date: 2010-09-20 13:00:42 -0400 (Mon, 20 Sep 2010)
New Revision: 4311
Modified:
mgmt/newdata/cumin/python/cumin/messaging/binding.py
Log:
Can't use try/except/finally on older pythons (#2)
Modified: mgmt/newdata/cumin/python/cumin/messaging/binding.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/binding.py 2010-09-20 16:56:26 UTC (rev
4310)
+++ mgmt/newdata/cumin/python/cumin/messaging/binding.py 2010-09-20 17:00:42 UTC (rev
4311)
@@ -101,14 +101,15 @@
queue = None
exchange = None
try:
- cls = self.app.model.org_apache_qpid_broker.Queue
- queue = cls.get_object_by_id(cursor, binding._queueRef_id)
- cls = self.app.model.org_apache_qpid_broker.Exchange
- exchange = cls.get_object_by_id(cursor, binding._exchangeRef_id)
- except Exception, e:
- invoc.status = "failed"
- invoc.exception = e
- log.exception(e)
+ try:
+ cls = self.app.model.org_apache_qpid_broker.Queue
+ queue = cls.get_object_by_id(cursor, binding._queueRef_id)
+ cls = self.app.model.org_apache_qpid_broker.Exchange
+ exchange = cls.get_object_by_id(cursor, binding._exchangeRef_id)
+ except Exception, e:
+ invoc.status = "failed"
+ invoc.exception = e
+ log.exception(e)
finally:
conn.close()