Repository: yt-dlp/yt-dlp
File: yt_dlp/update.py (Python)

Code before:
        if libc_ver < (2, 35):
            return EXE_MSG_TMPL.format('system glibc version < 2.35', 'issues/13858', STOP_MSG)
        return None

    return f'Support for Python version {major}.{minor} has been deprecated. {PYTHON_MSG}'


def _get_version_age_warning():
    # Only yt-dlp guarantees a stable release at least every 3 months
    if not ORIGIN.startswith('yt-dlp/'):
        return None

    try:
        version_parts = version_tuple(__version__)
        if len(version_parts) < 3:
            return None

        update_message = UPDATE_HINT or 'Run "yt-dlp --update" to update'

        if dt.date(*version_parts[:3]) < dt.datetime.now(dt.timezone.utc).date() - dt.timedelta(days=90):
            return ('\n         '.join((
                f'Your yt-dlp version ({__version__}) is older than 90 days!',
                'It is strongly recommeded to always use the latest versions, as sites regularly change and extractors need to be adjusted.',
                f'{update_message}. To suppress this warning, add "--no-update" to your command/config.')))
    except Exception:
        pass

    return None


def _sha256_file(path):
    h = hashlib.sha256()
    mv = memoryview(bytearray(128 * 1024))
    with open(os.path.realpath(path), 'rb', buffering=0) as f:
        for n in iter(lambda: f.readinto(mv), 0):
            h.update(mv[:n])
    return h.hexdigest()


def _make_label(origin, tag, version=None):
    if '/' in origin:
        channel = _INVERSE_UPDATE_SOURCES.get(origin, origin)
    else:
        channel = origin
    label = f'{channel}@{tag}'
    if version and version != tag:
        label += f' build {version}'
    if channel != origin:
        label += f' from {origin}'
    return label


Review comment (suggestion):
since we are suppressing all Exceptions and this code is only running for releases where we control the version number, what if we simplified/condensed this a little bit?
```suggestion
    with contextlib.suppress(Exception):
        last_updated = dt.date(*version_tuple(__version__)[:3])
        if last_updated < dt.datetime.now(dt.timezone.utc).date() - dt.timedelta(days=90):
            return ('\n         '.join((
                f'Your yt-dlp version ({__version__}) is older than 90 days!',
                'It is strongly recommended to always use the latest version.',
                f'{UPDATE_HINT or """Run "yt-dlp -U" to update"""}.',
                'To suppress this warning, add --no-update to your command/config.')))
```

Code after:
        if libc_ver < (2, 35):
            return EXE_MSG_TMPL.format('system glibc version < 2.35', 'issues/13858', STOP_MSG)
        return None

    return f'Support for Python version {major}.{minor} has been deprecated. {PYTHON_MSG}'


def _get_outdated_warning():
    # Only yt-dlp guarantees a stable release at least every 90 days
    if not ORIGIN.startswith('yt-dlp/'):
        return None

    with contextlib.suppress(Exception):
        last_updated = dt.date(*version_tuple(__version__)[:3])
        if last_updated < dt.datetime.now(dt.timezone.utc).date() - dt.timedelta(days=90):
            return ('\n         '.join((
                f'Your yt-dlp version ({__version__}) is older than 90 days!',
                'It is strongly recommended to always use the latest version.',
                f'{is_non_updateable() or """Run "yt-dlp --update" or "yt-dlp -U" to update"""}.',
                'To suppress this warning, add --no-update to your command/config.')))
    return None


def _sha256_file(path):
    h = hashlib.sha256()
    mv = memoryview(bytearray(128 * 1024))
    with open(os.path.realpath(path), 'rb', buffering=0) as f:
        for n in iter(lambda: f.readinto(mv), 0):
            h.update(mv[:n])
    return h.hexdigest()


def _make_label(origin, tag, version=None):
    if '/' in origin:
        channel = _INVERSE_UPDATE_SOURCES.get(origin, origin)
    else:
        channel = origin
    label = f'{channel}@{tag}'
    if version and version != tag:
        label += f' build {version}'
    if channel != origin:
        label += f' from {origin}'
    return label


@dataclass
class UpdateInfo:
    """
    Update target information

    Can be created by `query_update()` or manually.