@classmethod
def handle_return_values(cls, values):
    """Selects an appropriate return value from all callsites

        After an callsite has returned a value from this event, this will select
        the first not None value and return it.

        Subclassses can override this if they need to handle multiple return
        values differently
        """
    for retval in values:
        if retval is not None:
            if cls.returnclass and not isinstance(retval, cls.returnclass
                ) and not isinstance(retval, cls.returnclass):
                raise TypeError('Expected return value to be %s, got %s' %
                    (cls.returnclass, type(retval)))
            return retval
