Skip to content

Commit

Permalink
Add a regression test for AttributeError for Subscript object
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Jul 21, 2021
1 parent d52584d commit d035d96
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Expand Up @@ -26,6 +26,11 @@ Release date: TBA

Closes #4692

* Fix a crash when there would be a 'TypeError object does not support
item assignment' in the code we parse.

Closes #4439


What's New in Pylint 2.9.4?
===========================
Expand Down
13 changes: 13 additions & 0 deletions tests/functional/r/regression/regression_4439.py
@@ -0,0 +1,13 @@
"""AttributeError: 'Subscript' object has no attribute 'name' """
# pylint: disable=missing-docstring

from typing import Optional

from attr import attrib, attrs


@attrs()
class User:
name: str = attrib()
age: int = attrib()
occupation = Optional[str] = attrib(default=None) # [unsupported-assignment-operation]
1 change: 1 addition & 0 deletions tests/functional/r/regression/regression_4439.txt
@@ -0,0 +1 @@
unsupported-assignment-operation:13:17:User:'Optional' does not support item assignment:HIGH

0 comments on commit d035d96

Please sign in to comment.