Skip to content

Commit

Permalink
Merge pull request #107 from tekktrik/doc/rerun-black
Browse files Browse the repository at this point in the history
Use typing_extensions.Protocol if needed
  • Loading branch information
dhalbert committed Mar 29, 2022
2 parents 3dc3bec + cf17c20 commit 7ac2df5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions adafruit_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ def cast(_t, value):
"""No-op shim for the typing.cast() function which is not available in CircuitPython."""
return value


else:
from ssl import SSLContext
from types import ModuleType, TracebackType
from typing import Any, Dict, List, Optional, Protocol, Tuple, Type, Union, cast
from typing import Any, Dict, List, Optional, Tuple, Type, Union, cast

try:
from typing import Protocol
except ImportError:
from typing_extensions import Protocol

# Based on https://github.com/python/typeshed/blob/master/stdlib/_socket.pyi
class CommonSocketType(Protocol):
Expand Down

0 comments on commit 7ac2df5

Please sign in to comment.