def current_umask():
    """Get the current umask which involves having to set it temporarily."""
    mask = os.umask(0)
    os.umask(mask)
    return mask
Get the current umask which involves having to set it temporarily.
product/gradle-plugin/src/main/python/pip/_internal/utils/unpacking.py