[Stackless] Stackless for Python 2.5b2 / help required

Jeff Senn senn at maya.com
Thu Aug 3 15:38:40 CEST 2006



Jeff Senn wrote:
> Something seems to be getting messed up on the VM valuestack.
> The actual problem is that we get to the very end of the
> test that is failing (and in (contextlib.py:def nested(...)" the last  
> finally)

More data - I did some digging by putting some of my own trace
code in the VM.  Apparently the stack is set up incorrectly
in a case after a function returns (normally) in a finally block where
an exception has been caught (and suppressed) in the try.

It seems like only the return value is being pushed onto the empty stack.
At this point the non-stackless version of Python would have
both the return value *and* the 'why' code for the END_FINALLY. (Perhaps
stackless is incorrectly POPing this when it unwinds?)

I'm really surprised that this is not more ubiquitous...
we're lucky the contextlib test caught this, as it has nothing
to do with the new 'with' behavior.

I'm not sure how to resolve it... Richard?

Included below is a tiny test case that breaks.

-Jas


def bar(a): return 0
def test():
     try:
	try:
	    raise "foo"
	except:
	    pass
     finally:
	try:
	    if bar(0):
		pass
	except:
	    pass
test()


_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list