tests/crashgetbundler.py
author Augie Fackler <augie@google.com>
Sat, 14 Oct 2017 11:30:17 -0400
changeset 34723 b13c95919ff5
parent 30876 f3807a135e43
child 43076 2372284d9457
permissions -rw-r--r--
templater: explode if we try to emit a str Without this if branch, we infinitely recurse in _flatten, which is very confusing. Something in an hgweb template is trying to write out a string instead of a bytes on Python 3, and this at least makes it crash politely. Differential Revision: https://phab.mercurial-scm.org/D1088

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)