-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
C: unused-variableFalse Negative 🦋No message is emitted but something is wrong with the codeNo message is emitted but something is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementationRegressionUnreleased
Milestone
Description
Bug description
import logging
def func(module):
try:
module.compute()
error = False
except module.TimeoutError as e:
logging.error('Timed out: %s', e)
error = True
if error:
# Try again with larger timeout.
try:
module.compute(timeout=1200)
except module.Error as e:
pass
Configuration
No response
Command used
pylint a.py
Pylint output
-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 9.23/10, +0.77)
Expected behavior
It should raise unused-variable
for the second e
:
************* Module unused
t.py:15:4: W0612: Unused variable 'e' (unused-variable)
Your code has been rated at 9.23/10 (previous run: 10.00/10, -0.77)
Pylint version
This is a regression in the latest alpha:
pylint 3.0.0a6
astroid 2.15.3
Python 3.11.1 (main, Jan 10 2023, 15:08:01) [Clang 14.0.0 (clang-1400.0.29.202)]
And working as expected in 2.17.2
OS / Environment
No response
Additional dependencies
No response
Metadata
Metadata
Assignees
Labels
C: unused-variableFalse Negative 🦋No message is emitted but something is wrong with the codeNo message is emitted but something is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementationRegressionUnreleased