Commit 53ac23cc authored by Julien Muchembled's avatar Julien Muchembled

Fix try...finally construct for Python < 2.5

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42906 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cc7b1372
......@@ -286,13 +286,13 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
raise AttributeError("Could not find a portal type class in"
" class hierarchy")
ERP5Base.aq_method_lock.acquire()
portal_type = klass.__name__
from Products.ERP5.ERP5Site import getSite
site = getSite()
ERP5Base.aq_method_lock.acquire()
try:
try:
try:
class_definition = generatePortalTypeClass(site, portal_type)
except AttributeError:
LOG("ERP5Type.Dynamic", WARNING,
......@@ -319,7 +319,7 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
classImplements(klass, interface)
klass.generatePortalTypeAccessors(site)
except:
except Exception:
import traceback; traceback.print_exc()
finally:
ERP5Base.aq_method_lock.release()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment