def except_with_handler():
"""Raise an exception which is handled after abort."""
site = zope.component.hooks.getSite()
site['foo'] = 'bar'
def handler(arg1, arg2, kw1=1, kw2=2):
interaction = zope.security.management.getInteraction()
site['data'] = (arg1, arg2, kw1, kw2,
interaction.participations[0].principal.title)
raise HandleAfterAbort(handler, 'a1', 'a2', kw2=4)
评论列表
文章目录