test_celery.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:z3c.celery 作者: ZeitOnline 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号