Skip to content
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

Avoid index errors that cause Mypy to raise Internal Error #1317

Merged

Conversation

jimmylai
Copy link
Contributor

Avoid index errors that cause Mypy to raise Internal Error

Mypy failed by the following internal error in our codebase

error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
If this issue continues with mypy master, please report a bug at https://github.com/python/mypy/issues
version: 0.991

After investigation, it's caused by an IndexError in mypy_django_plugin.transformers.orm_lookups
This fix adds boundary checks on arg_types and arg_names to avoid the IndexError.
With this patch, Mypy runs successfully without raising internal errors.

Related issues

@sobolevn sobolevn merged commit ab8bf7f into typeddjango:master Jan 11, 2023
@sobolevn
Copy link
Member

Thank you!

@jimmylai jimmylai deleted the fix_orm_lookups_internal_errors branch January 12, 2023 19:32
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.

None yet

2 participants