From cf524cb6b19dc971610452986f1ce8d1001d9d7e Mon Sep 17 00:00:00 2001 From: dherrada <=> Date: Mon, 18 May 2020 18:59:14 -0400 Subject: [PATCH] extract_pyi no longer raises a TypeError for missing types --- tools/extract_pyi.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index d6309212a0..7c664d9653 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -64,18 +64,16 @@ for module in modules: if j.returns: if 'Any' in j.returns.__dict__.values(): a += f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}" - if a: - raise TypeError(a) elif isinstance(j, astroid.node_classes.AnnAssign): if 'Any' == j.__dict__['annotation'].__dict__['name']: - raise TypeError(f"missing attribute type on line {j.__dict__['lineno']}") + a = f"missing attribute type on line {j.__dict__['lineno']}" + if a: + print(a) ok += 1 except astroid.exceptions.AstroidSyntaxError as e: e = e.__cause__ traceback.print_exception(type(e), e, e.__traceback__) - except TypeError as err: - print(err) print(f"{ok} ok out of {total}")