Skip to content

Commit

Permalink
fallback for Literal python37
Browse files Browse the repository at this point in the history
  • Loading branch information
FoamyGuy committed May 20, 2022
1 parent 39b374c commit c5b4732
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion adafruit_fona/adafruit_fona.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@
from simpleio import map_range

try:
from typing import Optional, Tuple, Union, Literal
from typing import Optional, Tuple, Union
from circuitpython_typing import ReadableBuffer
from busio import UART
from digitalio import DigitalInOut

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
except ImportError:
pass

Expand Down
6 changes: 5 additions & 1 deletion adafruit_fona/fona_3g.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@
from .adafruit_fona import FONA, REPLY_OK

try:
from typing import Optional, Tuple, Union, Literal
from typing import Optional, Tuple, Union
from busio import UART
from digitalio import DigitalInOut
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
except ImportError:
pass

Expand Down

0 comments on commit c5b4732

Please sign in to comment.