Skip to content

Commit

Permalink
Fix old python
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusSintonen committed Jun 16, 2024
1 parent 2611f3c commit e5ac06c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions httpcore/_backends/auto.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import typing
from importlib.util import find_spec
from typing import Optional
from typing import Optional, Type

from .._synchronization import current_async_backend
from .base import SOCKET_OPTION, AsyncNetworkBackend, AsyncNetworkStream
Expand All @@ -10,14 +10,14 @@

class AutoBackend(AsyncNetworkBackend):
@staticmethod
def set_default_backend(backend_class: type[AsyncNetworkBackend] | None) -> None:
def set_default_backend(backend_class: Optional[Type[AsyncNetworkBackend]]) -> None:
setattr(AutoBackend, "_default_backend_class", backend_class)

async def _init_backend(self) -> None:
if hasattr(self, "_backend"):
return

default_backend_class: type[AsyncNetworkBackend] | None = getattr(
default_backend_class: Optional[Type[AsyncNetworkBackend]] = getattr(
AutoBackend, "_default_backend_class", None
)
if default_backend_class is not None:
Expand Down

0 comments on commit e5ac06c

Please sign in to comment.