diff --git a/doc/whatsnew/fragments/8554.bugfix b/doc/whatsnew/fragments/8554.bugfix new file mode 100644 index 0000000000..5bb60ae157 --- /dev/null +++ b/doc/whatsnew/fragments/8554.bugfix @@ -0,0 +1,3 @@ +Fixed crash when a call to ``super()`` was placed after an operator (e.g. ``not``). + +Closes #8554 diff --git a/pyproject.toml b/pyproject.toml index bd542646b3..6e8fb90ebe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ dependencies = [ # Also upgrade requirements_test_min.txt. # Pinned to dev of second minor update to allow editable installs and fix primer issues, # see https://github.com/pylint-dev/astroid/issues/1341 - "astroid>=2.15.4,<=2.17.0-dev0", + "astroid>=2.15.5,<=2.17.0-dev0", "isort>=4.2.5,<6", "mccabe>=0.6,<0.8", "tomli>=1.1.0;python_version<'3.11'", diff --git a/requirements_test_min.txt b/requirements_test_min.txt index 499d287f64..9d44ad110c 100644 --- a/requirements_test_min.txt +++ b/requirements_test_min.txt @@ -1,6 +1,6 @@ -e .[testutils,spelling] # astroid dependency is also defined in pyproject.toml -astroid==2.15.4 # Pinned to a specific version for tests +astroid==2.15.5 # Pinned to a specific version for tests typing-extensions~=4.5 py~=1.11.0 pytest~=7.2 diff --git a/tests/functional/i/invalid/invalid_unary_operand_type.py b/tests/functional/i/invalid/invalid_unary_operand_type.py index 5881f89ec9..3f8c824851 100644 --- a/tests/functional/i/invalid/invalid_unary_operand_type.py +++ b/tests/functional/i/invalid/invalid_unary_operand_type.py @@ -49,3 +49,10 @@ class A: invert_instance = ~A() # [invalid-unary-operand-type] invert_module = ~collections # [invalid-unary-operand-type] invert_float = ~2.0 # [invalid-unary-operand-type] + + +class NoArgumentSuper: + def __init__(self): + """https://github.com/pylint-dev/pylint/issues/8554""" + if not isinstance(super(), float): + pass