Skip to content

Commit

Permalink
Fixed compatibility with Python 3.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Nov 10, 2019
1 parent a28cee8 commit da05d39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions typeguard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ def __init__(self, func: Callable, frame_locals: Optional[Dict[str, Any]] = None
self.type_hints = _type_hints_map.get(func)
if self.type_hints is None:
while True:
if sys.version_info < (3, 5, 3):
frame_locals = dict(frame_locals)

try:
hints = get_type_hints(func, localns=frame_locals)
except NameError as exc:
Expand Down

0 comments on commit da05d39

Please sign in to comment.