Avoid runtime ParamType subscription
This commit is contained in:
parent
cce3a8f3e1
commit
4e584a238b
1 changed files with 3 additions and 2 deletions
|
|
@ -7,7 +7,6 @@ import inspect
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
import ssl
|
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
import typing as t
|
import typing as t
|
||||||
|
|
@ -26,6 +25,8 @@ from .helpers import get_debug_flag
|
||||||
from .helpers import get_load_dotenv
|
from .helpers import get_load_dotenv
|
||||||
|
|
||||||
if t.TYPE_CHECKING:
|
if t.TYPE_CHECKING:
|
||||||
|
import ssl
|
||||||
|
|
||||||
from _typeshed.wsgi import StartResponse
|
from _typeshed.wsgi import StartResponse
|
||||||
from _typeshed.wsgi import WSGIApplication
|
from _typeshed.wsgi import WSGIApplication
|
||||||
from _typeshed.wsgi import WSGIEnvironment
|
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'}")
|
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
|
"""Click option type for the ``--cert`` option. Allows either an
|
||||||
existing file, the string ``'adhoc'``, or an import for a
|
existing file, the string ``'adhoc'``, or an import for a
|
||||||
:class:`~ssl.SSLContext` object.
|
:class:`~ssl.SSLContext` object.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue