tests/crashgetbundler.py
author Yuya Nishihara <yuya@tcha.org>
Tue, 09 Oct 2018 07:46:01 +0900
changeset 40100 ca4a32d0a4d6
parent 30914 f3807a135e43
child 43076 2372284d9457
permissions -rw-r--r--
fuzz: report error if Python code raised exception I think that's what we wanted to do, given the most of the code block is surrounded by try-except. 'lazymanifest(mdata)' is moved to the try block as it can fail.

from __future__ import absolute_import

from mercurial.i18n import _
from mercurial import (
        changegroup,
        error,
        extensions
    )

def abort(orig, *args, **kwargs):
    raise error.Abort(_('this is an exercise'))

def uisetup(ui):
    extensions.wrapfunction(changegroup, 'getbundler', abort)