Skip to content

Commit

Permalink
Attempt to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erezsh committed Oct 9, 2022
1 parent b0c8358 commit 72dfb05
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions runtype/utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
import inspect
import sys

try:
from typing import ForwardRef
except ImportError:
if sys.version_info < (3, 7):
# python 3.6
from typing import _ForwardRef as ForwardRef
_orig_eval = ForwardRef._eval_type
elif sys.version_info < (3, 9):
from typing import ForwardRef
_orig_eval = ForwardRef._evaluate
else:
from typing import ForwardRef

if sys.version_info < (3, 9):
def _evaluate(self, g, l, _):
return self._eval_type(g, l)
return _orig_eval(self, g, l)
ForwardRef._evaluate = _evaluate



def get_func_signatures(typesystem, f):
sig = inspect.signature(f)
typesigs = []
Expand Down

0 comments on commit 72dfb05

Please sign in to comment.