Skip to content

AttributeError: 'Attribute' object has no attribute 'name' in nested-min-max checker #10626

@correctmost

Description

@correctmost

Bug description

This test case from ruff's nested-min-max checker crashes Pylint:

import builtins
builtins.min(1, min(2, 3))

Configuration

Command used

pylint crash.py

Pylint output

Traceback (most recent call last):
  File "pylint/pylint/utils/ast_walker.py", line 87, in walk
    callback(astroid)
    ~~~~~~~~^^^^^^^^^
  File "pylint/pylint/checkers/nested_min_max.py", line 79, in visit_call
    redundant_calls = self.get_redundant_calls(node)
  File "pylint/pylint/checkers/nested_min_max.py", line 66, in get_redundant_calls
    and arg.func.name == node.func.name
                         ^^^^^^^^^^^^^^
AttributeError: 'Attribute' object has no attribute 'name'. Did you mean: 'frame'?

Expected behavior

No crash

Pylint version

pylint: 5f0298d
astroid: pylint-dev/astroid@2ce47a2cc046
Python 3.13.7

OS / Environment

Arch Linux

Additional dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    Crash 💥A bug that makes pylint crash

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions