Skip to content

Commit

Permalink
Restore compatibility with Python < 3.11.
Browse files Browse the repository at this point in the history
Broken in 9038a62.
  • Loading branch information
aaugustin committed Jan 13, 2024
1 parent 5209b2a commit 3c6b1aa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/websockets/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import http
import logging
import typing
from typing import Any, List, NewType, Optional, Tuple, Union


Expand All @@ -28,8 +29,12 @@
"""


LoggerLike = Union[logging.Logger, logging.LoggerAdapter[Any]]
"""Types accepted where a :class:`~logging.Logger` is expected."""
if typing.TYPE_CHECKING:
LoggerLike = Union[logging.Logger, logging.LoggerAdapter[Any]]
"""Types accepted where a :class:`~logging.Logger` is expected."""
else: # remove this branch when dropping support for Python < 3.11
LoggerLike = Union[logging.Logger, logging.LoggerAdapter]
"""Types accepted where a :class:`~logging.Logger` is expected."""


StatusLike = Union[http.HTTPStatus, int]
Expand Down

0 comments on commit 3c6b1aa

Please sign in to comment.