def is_this_module(this_module, m):
    """
    Returns whether 'm' is the same as 'this_module'
    """
    # Same source
    if this_module.location and m.location and this_module.location.filename == m.location.filename:
        return True
    # Same name and cabal
    if this_module.cabal and m.cabal and this_module.cabal == m.cabal and this_module.name == m.name:
        return True
    return False