From: SourceForge.net <no...@so...> - 2003-07-31 18:02:44
|
Bugs item #577395, was opened at 2002-07-04 12:45 Message generated for change (Settings changed) made by pedronis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=577395&group_id=12867 Category: Core >Group: Fixed in 2.2a0 Status: Closed Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Finn Bock (bckfnn) Summary: Outer finally not executed at return Initial Comment: 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 yk...@xs... ---------------------------------------------------------------------- Comment By: Finn Bock (bckfnn) Date: 2002-10-09 14:10 Message: Logged In: YES user_id=4201 Fixed in CodeCompiler.java: 2.29 using patch supplied by Ype Kingma. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=577395&group_id=12867 |