summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJeff Epler <jeff@adafruit.com>2020-08-10 11:59:39 -0500
committerGitHub <noreply@github.com>2020-08-10 11:59:39 -0500
commitce911c5f5057cf72509ed9e704b46a66423b95d6 (patch)
tree5949295e94e382922132c92d9543c97be1e2aab2 /tools
parentfee3c0afbdeff4b11539e70ad42ae8a7136423ed (diff)
parentad04b8cfd37697cf50bebf649b3ecabb7c182b92 (diff)
Merge pull request #3255 from ciscorn/fix-rtd
Fix Read the Docs bulid failing
Diffstat (limited to 'tools')
-rw-r--r--tools/extract_pyi.py5
1 files changed, 4 insertions, 1 deletions
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):