def register_patch(name, klass, instance=None, update_tryorder=None, preferred=False):
        """
        Wrapper around webbrowser.register() that detects if the function was
        invoked with the legacy function signature. If so, the signature is
        fixed before passing it along to the underlying function.

        Examples:
            register(name, klass, instance, -1)
            register(name, klass, instance, update_tryorder=-1)
            register(name, klass, instance, preferred=True)
        """
        if update_tryorder is not None:
            preferred = (update_tryorder == -1)
        return webbrowser._register(name, klass, instance, preferred=preferred)

        Wrapper around webbrowser.register() that detects if the function was
        invoked with the legacy function signature. If so, the signature is
        fixed before passing it along to the underlying function.

        Examples:
            register(name, klass, instance, -1)
            register(name, klass, instance, update_tryorder=-1)
            register(name, klass, instance, preferred=True)
        
rtv/objects.py