Commit e28d96e5 authored by Vincent Pelletier's avatar Vincent Pelletier

Oops, stupid syntax error: a single "try" block cannot have both "except" and...

Oops, stupid syntax error: a single "try" block cannot have both "except" and "finally" section. Split.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19084 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0e65c6ec
...@@ -567,35 +567,36 @@ class ActivityTool (Folder, UniqueObject): ...@@ -567,35 +567,36 @@ class ActivityTool (Folder, UniqueObject):
old_sm = getSecurityManager() old_sm = getSecurityManager()
try: try:
# get owner of portal_catalog, so normally we should be able to try:
# have the permission to invoke all activities # get owner of portal_catalog, so normally we should be able to
user = self.portal_catalog.getWrappedOwner() # have the permission to invoke all activities
newSecurityManager(self.REQUEST, user) user = self.portal_catalog.getWrappedOwner()
newSecurityManager(self.REQUEST, user)
currentNode = self.getCurrentNode()
self.registerNode(currentNode) currentNode = self.getCurrentNode()
processing_node_list = self.getNodeList(role=ROLE_PROCESSING) self.registerNode(currentNode)
processing_node_list = self.getNodeList(role=ROLE_PROCESSING)
# only distribute when we are the distributingNode or if it's empty
if (self.getDistributingNode() == currentNode): # only distribute when we are the distributingNode or if it's empty
self.distribute(len(processing_node_list)) if (self.getDistributingNode() == currentNode):
self.distribute(len(processing_node_list))
# SkinsTool uses a REQUEST cache to store skin objects, as
# with TimerService we have the same REQUEST over multiple # SkinsTool uses a REQUEST cache to store skin objects, as
# portals, we clear this cache to make sure the cache doesn't # with TimerService we have the same REQUEST over multiple
# contains skins from another portal. # portals, we clear this cache to make sure the cache doesn't
stool = getToolByName(self, 'portal_skins', None) # contains skins from another portal.
if stool is not None: stool = getToolByName(self, 'portal_skins', None)
stool.changeSkin(None) if stool is not None:
stool.changeSkin(None)
# call tic for the current processing_node
# the processing_node numbers are the indices of the elements in the node tuple +1 # call tic for the current processing_node
# because processing_node starts form 1 # the processing_node numbers are the indices of the elements in the node tuple +1
if currentNode in processing_node_list: # because processing_node starts form 1
self.tic(processing_node_list.index(currentNode)+1) if currentNode in processing_node_list:
except: self.tic(processing_node_list.index(currentNode)+1)
# Catch ALL exception to avoid killing timerserver. except:
LOG('ActivityTool', ERROR, 'process_timer received an exception', error=sys.exc_info()) # Catch ALL exception to avoid killing timerserver.
LOG('ActivityTool', ERROR, 'process_timer received an exception', error=sys.exc_info())
finally: finally:
timerservice_lock.release() timerservice_lock.release()
setSecurityManager(old_sm) setSecurityManager(old_sm)
......
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