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