From 272d300fc8984434fa683caeb5b7bc52effe4dd9 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Sat, 8 Aug 2020 01:33:24 +0900 Subject: Fix Read the Docs bulid failing --- tools/extract_pyi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 4d82e9e5d..651216e11 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -45,7 +45,10 @@ def find_stub_issues(tree): if isinstance(node.value, ast.Constant) and node.value.value == Ellipsis: yield ("WARN", f"Unnecessary Ellipsis assignment (= ...) on line {node.lineno}.") elif isinstance(node, ast.arguments): - for arg_node in (node.args + node.posonlyargs + node.kwonlyargs): + allargs = list(node.args + node.kwonlyargs) + if sys.version_info >= (3, 8): + allargs.extend(node.posonlyargs) + for arg_node in allargs: if not is_typed(arg_node.annotation) and (arg_node.arg != "self" and arg_node.arg != "cls"): yield ("WARN", f"Missing argument type: {arg_node.arg} on line {arg_node.lineno}") if node.vararg and not is_typed(node.vararg.annotation, allow_any=True): -- cgit v1.2.3