Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
erp5
Commits
382dd438
Commit
382dd438
authored
Aug 08, 2013
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove useless except block and use with statement for lock instead try/finally block.
parent
3181d5ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
8 deletions
+1
-8
product/ERP5Type/dynamic/lazy_class.py
product/ERP5Type/dynamic/lazy_class.py
+1
-8
No files found.
product/ERP5Type/dynamic/lazy_class.py
View file @
382dd438
...
@@ -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
,),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment