Skip to content

Commit cf524cb

Browse files
author
dherrada
committed
extract_pyi no longer raises a TypeError for missing types
1 parent acf88d7 commit cf524cb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tools/extract_pyi.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,16 @@
6464
if j.returns:
6565
if 'Any' in j.returns.__dict__.values():
6666
a += f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}"
67-
if a:
68-
raise TypeError(a)
6967
elif isinstance(j, astroid.node_classes.AnnAssign):
7068
if 'Any' == j.__dict__['annotation'].__dict__['name']:
71-
raise TypeError(f"missing attribute type on line {j.__dict__['lineno']}")
69+
a = f"missing attribute type on line {j.__dict__['lineno']}"
70+
if a:
71+
print(a)
7272

7373
ok += 1
7474
except astroid.exceptions.AstroidSyntaxError as e:
7575
e = e.__cause__
7676
traceback.print_exception(type(e), e, e.__traceback__)
77-
except TypeError as err:
78-
print(err)
7977

8078
print(f"{ok} ok out of {total}")
8179

0 commit comments

Comments
 (0)