Issue577395
Created on 2002-07-04.12:45:54 by anonymous, last changed 2002-10-09.14:10:02 by bckfnn.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2002-07-04 12:45:54 | anonymous | create | |
Created on 2002-07-04.12:45:54 by anonymous, last changed 2002-10-09.14:10:02 by bckfnn.
| Messages | |||
|---|---|---|---|
| msg681 (view) | Author: Nobody/Anonymous (nobody) | Date: 2002-07-04.12:45:54 | |
This program (also attached):
x = []
def trying():
try:
try:
x.append(1)
return
finally:
x.append(2)
finally:
x.append(3)
trying()
assert x == [1,2,3], repr(x)
outputs:
AssertionError: [1, 2]
Ie. the outer finally is not executed at return.
The workaround is simple: return after the last finally
and store an evt. return value in a temporary variable.
I did not experiment with raising exceptions instead
of returning.
In my case this bug caused a lock not to be released :)
Have fun,
Ype
ykingma@xs4all.nl
|
|||
| msg682 (view) | Author: Finn Bock (bckfnn) | Date: 2002-10-09.14:10:02 | |
Logged In: YES user_id=4201 Fixed in CodeCompiler.java: 2.29 using patch supplied by Ype Kingma. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2002-07-04 12:45:54 | anonymous | create | |
Supported by Python Software Foundation,
Powered by Roundup