You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/Users/xx/Library/Caches/pypoetry/virtualenvs/xxx-CJszIqT8-py3.11/bin/mypy", line 8, in <module>
sys.exit(console_entry())
^^^^^^^^^^^^^^^
File "/Users/xx/Library/Caches/pypoetry/virtualenvs/xxx-CJszIqT8-py3.11/lib/python3.11/site-packages/mypy/__main__.py", line 15, in console_entry
main()
File "mypy/main.py", line 100, in main
File "mypy/main.py", line 182, in run_build
File "mypy/build.py", line 191, in build
File "mypy/build.py", line 265, in _build
File "mypy/build.py", line 2890, in dispatch
File "mypy/build.py", line 3076, in load_graph
File "mypy/build.py", line 1998, in __init__
File "mypy/build.py", line 2292, in compute_dependencies
File "mypy/plugin.py", line 844, in get_additional_deps
File "/Users/xx/Library/Caches/pypoetry/virtualenvs/xxx-CJszIqT8-py3.11/lib/python3.11/site-packages/mypy_django_plugin/main.py", line 141, in get_additional_deps
related_model_module = related_model_cls.__module__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute '__module__'. Did you mean: '__reduce__'?
How is that should be
No errors
System information
OS:
python 3.11:
django 5.0.2:
mypy 1.8.0:
django-stubs 4.2.7:
django-stubs-ext 4.2.7:
The text was updated successfully, but these errors were encountered:
This refactors get_field_related_model_cls to raise an exception instead of returning None. However, the function still appears to be returning None in some cases.
These lines remove the None check in favour of catching the new exception. However, the following line is now failing for me and OP as we're getting None returned rather than an exception.
I've verified on my local that restoring the None check mentioned above fixes the crash and lets mypy continue for my project.
Bug report
What's wrong
mypy . --strict --explicit-package-bases
How is that should be
No errors
System information
python
3.11:django
5.0.2:mypy
1.8.0:django-stubs
4.2.7:django-stubs-ext
4.2.7:The text was updated successfully, but these errors were encountered: