Skip to content

Commit

Permalink
only ignoring type comment for Python version 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
PatMyron committed Dec 15, 2020
1 parent 8d62c87 commit 474895e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cloudformation_cli_python_lib/recast.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import typing
from typing import Any, Dict, List, Mapping, Set

Expand Down Expand Up @@ -127,5 +128,8 @@ def get_forward_ref_type() -> Any:
# introspection is valid:
# https://docs.python.org/3/library/typing.html#typing.ForwardRef
if "ForwardRef" in dir(typing):
return typing.ForwardRef # type: ignore
if sys.version_info > (3, 6):
return typing.ForwardRef
else:
return typing.ForwardRef # type: ignore
return typing._ForwardRef # type: ignore

0 comments on commit 474895e

Please sign in to comment.