From f5d02752c70fcbbf8b1cbde7148c176a5eb20948 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 25 Jun 2008 14:25:07 +0000 Subject: [PATCH] fix error in python < 2.5 bzr revid: chs@tinyerp.com-1a4fd26c58cb81e4ac358438187245aeaac5a849 --- bin/osv/osv.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/osv/osv.py b/bin/osv/osv.py index 4a76577da26..49099aa7142 100644 --- a/bin/osv/osv.py +++ b/bin/osv/osv.py @@ -135,14 +135,15 @@ class osv_pool(netsvc.Service): def exec_workflow(self, db, uid, obj, method, *args): cr = pooler.get_db(db).cursor() try: - res = self.exec_workflow_cr(cr, uid, obj, method, *args) - cr.commit() - except orm.except_orm, inst: - cr.rollback() - self.abortResponse(1, inst.name, 'warning', inst.value) - except except_osv, inst: - cr.rollback() - self.abortResponse(1, inst.name, inst[0], inst.value) + try: + res = self.exec_workflow_cr(cr, uid, obj, method, *args) + cr.commit() + except orm.except_orm, inst: + cr.rollback() + self.abortResponse(1, inst.name, 'warning', inst.value) + except except_osv, inst: + cr.rollback() + self.abortResponse(1, inst.name, inst[0], inst.value) finally: cr.close() return res