Skip to content

Commit 080d6e4

Browse files
committed
try another python 3.7 workaround
1 parent c459288 commit 080d6e4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/pyfabm/__init__.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@
1616
TypeVar,
1717
List,
1818
Dict,
19-
Literal,
2019
Type,
2120
overload,
22-
cast
21+
cast,
2322
)
2423

24+
# typing.Final not available in Python 3.7
25+
try:
26+
from typing import Final
27+
except ImportError:
28+
from typing import Any as Final
29+
2530
try:
2631
import importlib.metadata
2732

@@ -125,7 +130,7 @@ def get_lib(name: str) -> FABMDLL:
125130
lib.mask_type = mask_type.value
126131
lib.variable_bottom_index = variable_bottom_index.value != 0
127132

128-
CONTIGUOUS: Literal["CONTIGUOUS"] = "CONTIGUOUS"
133+
CONTIGUOUS: Final = "CONTIGUOUS"
129134
arrtype0D = np.ctypeslib.ndpointer(dtype=lib.dtype, ndim=0, flags=CONTIGUOUS)
130135
arrtype1D = np.ctypeslib.ndpointer(dtype=lib.dtype, ndim=1, flags=CONTIGUOUS)
131136
arrtypeInterior = np.ctypeslib.ndpointer(

0 commit comments

Comments
 (0)