Skip to content

Conversation

@cdce8p
Copy link
Member

@cdce8p cdce8p commented Oct 4, 2021

Type of Changes

Type
βœ“ πŸ› Bug fix

Description

# AssignAttr in orelse block of 'TYPE_CHECKING' shouldn't crash
# Name being assigned must be imported in orelse block
if TYPE_CHECKING:
    pass
else:
    from types import GenericAlias
    object().__class_getitem__ = classmethod(GenericAlias)

Closes #5111

@cdce8p cdce8p added this to the 2.11.2 milestone Oct 4, 2021
@cdce8p cdce8p added the Crash πŸ’₯ A bug that makes pylint crash label Oct 4, 2021
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1305568175

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.114%

Totals Coverage Status
Change from base Build 1303788367: 0.0%
Covered Lines: 13400
Relevant Lines: 14391

πŸ’› - Coveralls

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘

@cdce8p cdce8p merged commit f193806 into pylint-dev:main Oct 5, 2021
@cdce8p cdce8p deleted the fix_crash-AssignAttr branch October 5, 2021 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Crash πŸ’₯ A bug that makes pylint crash

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash 'AssignAttr' object has no attribute 'name' when not TYPE_CHECKING

3 participants