[issue17792] Unhelpful UnboundLocalError due to del'ing of exception target

Irit Katriel report at bugs.python.org
Wed Jun 2 09:13:18 EDT 2021


Irit Katriel <iritkatriel at yahoo.com> added the comment:

Following a discussion on PR24976 we opted for

"cannot access local variable 'x' where it is not associated with a value"

This is because binding it not always related to assignment.

I don't know whether this completely resolves this issue, or whether there is still something to change around the None-setting of except targets.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17792>
_______________________________________


More information about the Python-bugs-list mailing list