extract_pyi no longer raises a TypeError for missing types

This commit is contained in:
dherrada 2020-05-18 18:59:14 -04:00
parent acf88d7c00
commit cf524cb6b1
1 changed files with 3 additions and 5 deletions

View File

@ -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}")