Signal handlers can't be standard class methods because the signal
    callback does not include the object reference (self).  To work
    around this we use a closure the carry the object reference.

def legion_create_handler(obj):
    """
    Signal handlers can't be standard class methods because the signal
    callback does not include the object reference (self).  To work
    around this we use a closure the carry the object reference.
"""
    def _handler(sig, frame):
        obj._sig_handler(sig, frame)

    if '_sig_handler' not in dir(obj):                                                          # pragma: no cover
        raise Excecption("Object instance has no _sig_handler method")
    return _handler