Commit 382dd438 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Remove useless except block and use with statement for lock instead try/finally block.

parent 3181d5ad
...@@ -320,8 +320,7 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder): ...@@ -320,8 +320,7 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
portal_type = klass.__name__ portal_type = klass.__name__
from Products.ERP5.ERP5Site import getSite from Products.ERP5.ERP5Site import getSite
site = getSite() site = getSite()
aq_method_lock.acquire() with aq_method_lock:
try:
try: try:
class_definition = generatePortalTypeClass(site, portal_type) class_definition = generatePortalTypeClass(site, portal_type)
except AttributeError: except AttributeError:
...@@ -360,12 +359,6 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder): ...@@ -360,12 +359,6 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
# need to set %s__roles__ for generated methods # need to set %s__roles__ for generated methods
cls.setupSecurity() cls.setupSecurity()
except Exception:
import traceback; traceback.print_exc()
raise
finally:
aq_method_lock.release()
def generateLazyPortalTypeClass(portal_type_name): def generateLazyPortalTypeClass(portal_type_name):
return PortalTypeMetaClass(portal_type_name, return PortalTypeMetaClass(portal_type_name,
(InitGhostBase,), (InitGhostBase,),
......
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