Message369588
def foo(exc):
try:
1/0
except Exception as exc:
...
finally:
return exc
foo(1)
Executing the following code results in UnboundLocalError, while exc has been defined and passed to a function explicitly.
I think this is something similar to python2 issue when list comprehensions where overwriting local variable values, expected behaviour in here is that foo(1) returns 1 |
|
Date |
User |
Action |
Args |
2020-05-22 10:59:11 | oleksandr.suvorov | set | recipients:
+ oleksandr.suvorov |
2020-05-22 10:59:11 | oleksandr.suvorov | set | messageid: <1590145151.0.0.634189101704.issue40728@roundup.psfhosted.org> |
2020-05-22 10:59:10 | oleksandr.suvorov | link | issue40728 messages |
2020-05-22 10:59:10 | oleksandr.suvorov | create | |
|