driazati commented on code in PR #10906:
URL: https://github.com/apache/tvm/pull/10906#discussion_r843123158
##########
tests/scripts/ci.py:
##########
@@ -32,6 +32,8 @@
import subprocess
import platform
import textwrap
+import typing
Review Comment:
could you add the `#!` line in this PR too since its pretty trivial
##########
tests/scripts/ci.py:
##########
@@ -434,6 +436,26 @@ def cli_name(s: str) -> str:
return s.replace("_", "-")
+def typing_get_origin(annotation):
+ if sys.version_info >= (3, 8):
+ return typing.get_origin(annotation)
+ else:
+ return annotation.__origin__
+
+
+def typing_get_args(annotation):
+ if sys.version_info >= (3, 8):
+ return typing.get_args(annotation)
+ else:
+ return annotation.__args__
+
+
+def is_optional_type(annotation):
Review Comment:
this bit fixes the 3.7 issue
```suggestion
def is_optional_type(annotation):
if not hasattr(annotation, "__origin__"):
return False
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]