Skip to content

INTERNAL ERROR - AttributeError: 'SemanticAnalyzer' object has no attribute 'builtin_type' #11911

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

Closed
1riatsila1 opened this issue Jan 5, 2022 · 3 comments
Labels
bug mypy got something wrong

Comments

@1riatsila1
Copy link

Bug Report

Receiving INTERNAL ERROR when running mypy . on my project

To Reproduce

(Write your steps here:)

  1. Have the following dependencies
mypy==0.930
mypy-extensions==0.4.3
SQLAlchemy==1.4.29
sqlalchemy-stubs==0.4
SQLAlchemy-Utils==0.38.2
  1. Have the following code in your project
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()
  1. mypy .

Expected Behavior

Mypy generates error report as usual.

Actual Behavior

mypy --show-traceback .         
...: error: INTERNAL ERROR -- Please try using mypy master on Github:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 0.930
Traceback (most recent call last):
  File "mypy/semanal.py", line 5132, in accept
  File "mypy/nodes.py", line 1140, in accept
  File "mypy/semanal.py", line 2110, in visit_assignment_stmt
  File "mypy/semanal.py", line 2392, in apply_dynamic_class_hook
  File ".../lib/python3.8/site-packages/sqlmypy.py", line 203, in decl_info_hook
    obj = ctx.api.builtin_type('builtins.object')
AttributeError: 'SemanticAnalyzer' object has no attribute 'builtin_type'
....: : note: use --pdb to drop into pdb

Your Environment

  • Mypy version used: 0.930
  • Mypy command-line flags: None
  • Mypy configuration options from mypy.ini (and other config files):
[mypy]
disallow_untyped_defs = True
exclude = venv
plugins = sqlmypy
  • Python version used: 3.8.7
  • Operating system and version: MacOS 10.14.6
@1riatsila1 1riatsila1 added the bug mypy got something wrong label Jan 5, 2022
@A5rocks
Copy link
Collaborator

A5rocks commented Jan 5, 2022

This is a problem with the plugin, I think -- try raising an issue there.

@A5rocks
Copy link
Collaborator

A5rocks commented Jan 6, 2022

@hauntsaninja
Copy link
Collaborator

Thanks A5rocks! Closing this in favour of the issue linked in the plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

3 participants