Commit b1828b72 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Cosmetic: Since a29456bc, Base.aq_method_lock is a context manager ('with').

parent 57e0b92f
...@@ -318,9 +318,7 @@ def synchronizeDynamicModules(context, force=False): ...@@ -318,9 +318,7 @@ def synchronizeDynamicModules(context, force=False):
last_sync = cookie last_sync = cookie
import erp5 import erp5
with Base.aq_method_lock:
Base.aq_method_lock.acquire()
try:
# Thanks to TransactionalResource, the '_bootstrapped' global variable # Thanks to TransactionalResource, the '_bootstrapped' global variable
# is updated in a transactional way. Without it, it would be required to # is updated in a transactional way. Without it, it would be required to
# restart the instance if anything went wrong. # restart the instance if anything went wrong.
...@@ -389,9 +387,6 @@ def synchronizeDynamicModules(context, force=False): ...@@ -389,9 +387,6 @@ def synchronizeDynamicModules(context, force=False):
import traceback; traceback.print_exc() import traceback; traceback.print_exc()
raise raise
finally:
Base.aq_method_lock.release()
# It's okay for classes to keep references to old methods - maybe. # It's okay for classes to keep references to old methods - maybe.
# but we absolutely positively need to clear the workflow chains # but we absolutely positively need to clear the workflow chains
# stored in WorkflowMethod objects: our generation of workflow # stored in WorkflowMethod objects: our generation of workflow
......
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