Skip to content

Commit beffb80

Browse files
author
Sylvain MARIE
committed
Hopefully fixed import errors on python 2
1 parent 8d2c2dd commit beffb80

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

mini_lambda/base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from inspect import isclass
22

3-
from typing import Callable, Any, Tuple, Union, TypeVar
4-
5-
T = TypeVar('T')
3+
try: # python 3.5+
4+
from typing import Callable, Any, Tuple, Union, TypeVar
5+
T = TypeVar('T')
6+
except ImportError:
7+
pass
68

79
# see https://docs.python.org/3/reference/expressions.html#operator-precedence
810
from copy import copy

mini_lambda/goodies.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import Callable
2-
31
from mini_lambda.main import InputVar
42

53
# ******* Useful input variables ***********
@@ -19,4 +17,8 @@
1917
d = InputVar('d', dict)
2018

2119
# callables
22-
f = InputVar('f', Callable)
20+
try:
21+
from typing import Callable
22+
f = InputVar('f', Callable)
23+
except ImportError:
24+
pass

0 commit comments

Comments
 (0)