pylint-dev/pylint

`multiple-statements` no longer detected in a `finally:` block

oprypin opened this issue · 1 comments

Bug description

"""hi"""

try:
    pass
finally: pass  # Should complain about [multiple-statements] but doesn't

Configuration

# Empty configuration

Command used

/tmp/pylint/venv/bin/pylint test.py

Pylint output

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

Expected behavior

************* Module test
test.py:5:9: C0321: More than one statement on a single line (multiple-statements)

-------------------------------------------------------------------
Your code has been rated at 6.67/10 (previous run: 10.00/10, -3.33)

This behavior used to happen in the past.

5bdc221 is the first bad commit

Pylint version

pylint 3.3.0-dev0
astroid 3.3.0-dev0
Python 3.11.8 (main, May 26 2024, 00:40:16) [GCC 13.2.0]

OS / Environment

No response

Additional dependencies

No response

try and except are counted, while else and finally are not:

try:     pass   # flagged
except:  pass   # flagged
else:    pass   # ignored
finally: pass   # ignored