Skip to content

AttributeError exception in build_unannotated_method_args #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2020

Conversation

kszmigiel
Copy link
Member

It works, but I'm afraid it will backfire in the future. Let's see if it passes tests

@kszmigiel kszmigiel requested a review from sobolevn July 21, 2020 12:11
for argument in method_node.arguments[1:]:
argument.type_annotation = AnyType(TypeOfAny.unannotated)
prepared_arguments.append(argument)
try:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's write it like this:

try:
    arguments = method_node.arguments[1:]
except AttributeError:
    arguments = []

@sobolevn
Copy link
Member

Thanks a lot, @kszmigiel!

@sobolevn sobolevn merged commit 3915aa0 into typeddjango:master Jul 21, 2020
@kszmigiel kszmigiel mentioned this pull request Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

mypy crash when .mypy_cache is present
2 participants