From 4e584a238bfb313c4fa0c9ae741aa6a29a2acf63 Mon Sep 17 00:00:00 2001 From: jiyujie2006 <49909156+jiyujie2006@users.noreply.github.com> Date: Sun, 31 May 2026 15:06:58 +0800 Subject: [PATCH] Avoid runtime ParamType subscription --- src/flask/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/flask/cli.py b/src/flask/cli.py index d5f5ae93..26629d5c 100644 --- a/src/flask/cli.py +++ b/src/flask/cli.py @@ -7,7 +7,6 @@ import inspect import os import platform import re -import ssl import sys import traceback import typing as t @@ -26,6 +25,8 @@ from .helpers import get_debug_flag from .helpers import get_load_dotenv if t.TYPE_CHECKING: + import ssl + from _typeshed.wsgi import StartResponse from _typeshed.wsgi import WSGIApplication from _typeshed.wsgi import WSGIEnvironment @@ -776,7 +777,7 @@ def show_server_banner(debug: bool, app_import_path: str | None) -> None: click.echo(f" * Debug mode: {'on' if debug else 'off'}") -class CertParamType(click.ParamType[str | os.PathLike[str] | ssl.SSLContext]): +class CertParamType(click.ParamType): """Click option type for the ``--cert`` option. Allows either an existing file, the string ``'adhoc'``, or an import for a :class:`~ssl.SSLContext` object.