A possible bug in the transformers logging file

In this file transformers/logging.py at main 路 huggingface/transformers 路 GitHub there is a bug that I am not sure of so I wanted to discuss it here before sending a pull request, or opening a bug report issue on Github in case I misunderstood anything.

In this function:

def remove_handler(handler: logging.Handler) -> None:
    """removes given handler from the HuggingFace Transformers's root logger."""

    _configure_library_root_logger()

    assert handler is not None and handler not in _get_library_root_logger().handlers
    _get_library_root_logger().removeHandler(handler)

Shouldn鈥檛 it be

assert handler is not None and handle in _get_library_root_logger().handlers

Because if the handler is asserted to not be in the _get_library_root_logger().handlers, how will it be removed from the _get_library_root_logger?