************* Module test
test.py:2: [R1720(no-else-raise), f] Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it
test.py:9: [R1705(no-else-return), f] Unnecessary "else" after "return", remove the "else" and de-indent the code inside it
Expected behavior
No error reports.
As far as I understand, no-else-raise/no-else-return are supposed to be produced for if-else operators.
But in this example else is part of try-except-else operators, and the errors are completely inappropriate.
These aren't errors, they're refactoring messages. They still apply here, but we should update the documentation to clarify, since the documentation only mentions if/else.
Bug description
Configuration
No response
Command used
Pylint output
Expected behavior
No error reports.
As far as I understand,
no-else-raise
/no-else-return
are supposed to be produced forif
-else
operators.But in this example
else
is part oftry
-except
-else
operators, and the errors are completely inappropriate.Pylint version
OS / Environment
Ubuntu 24.04.1
Additional dependencies
No response