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

Crashes on metaclass=abs.olute.path.Class #3742

Closed
absurd34 opened this issue Jul 21, 2020 · 2 comments · Fixed by #3998
Closed

Crashes on metaclass=abs.olute.path.Class #3742

absurd34 opened this issue Jul 21, 2020 · 2 comments · Fixed by #3998
Assignees
Labels
Bug 🪲 Crash 💥 A bug that makes pylint crash

Comments

@absurd34
Copy link

Steps to reproduce

Run pylint on this code:

class Foo(metaclass=absolute.path.MetaFoo): pass

Current behavior

Crashes with Exception:

File "/usr/lib/python3/dist-packages/pylint/checkers/variables.py", line 2020, in _check_metaclasses
consumed.extend(self._check_classdef_metaclasses(child_node, node))
File "/usr/lib/python3/dist-packages/pylint/checkers/variables.py", line 2039, in _check_classdef_metaclasses
name = klass._metaclass.expr.name
AttributeError: 'Attribute' object has no attribute 'name'

Expected behavior

Don't crash.

pylint --version output

pylint 2.5.3
astroid 2.4.2
Python 3.8.5 (default, Jul 20 2020, 18:32:44)
[GCC 9.3.0]

Thx for looking into this.

S

@AWhetter AWhetter added Bug 🪲 Crash 💥 A bug that makes pylint crash labels Sep 8, 2020
@shamilbi
Copy link

shamilbi commented Dec 3, 2020

the same with pylint-2.6.0, python 3.8.6

@PCManticore
Copy link
Contributor

Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Crash 💥 A bug that makes pylint crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants