Skip to content

Commit 1a18cc7

Browse files
authored
Merge pull request #77 from tekktrik/fix/literal-import-failure
Fix compatibility for Python 3.7
2 parents d35387a + 04fd8dd commit 1a18cc7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

adafruit_rfm9x.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@
2828
pass
2929

3030
try:
31-
from typing import Optional, Type, Literal
31+
from typing import Optional, Type
3232
from digitalio import DigitalInOut
3333
from busio import SPI
3434
from circuitpython_typing import WriteableBuffer, ReadableBuffer
3535

36+
try:
37+
from typing import Literal
38+
except ImportError:
39+
from typing_extensions import Literal
40+
3641
except ImportError:
3742
pass
3843

0 commit comments

Comments
 (0)