Open
Description
Bug description
Looks like #5506 missed nested try blocks when accounting for (outer) try blocks that return.
def test():
try:
return [1 / 0]
except ZeroDivisionError:
try:
results = []
finally:
pass
return results # raises used-before-assignment
Configuration
No response
Command used
pylint a.py
Pylint output
************* Module a
a.py:9:11: E0601: Using variable 'results' before assignment (used-before-assignment)
Expected behavior
no msg
Pylint version
pylint 3.0.0b1
astroid 3.0.0a4-dev0
Python 3.11.2
OS / Environment
No response
Additional dependencies
No response