ANN: Stackless Python 0.3

Christian Tismer tismer at appliedbiometrics.com
Thu Jul 15 09:19:10 EDT 1999


Michael Hudson wrote:

...

> echo "fudge" | stackless-python
> 
> does *not* print an error!
> 
> echo "fudge" | stackless-python -i
> 
> does!

Yes, thanks. This has been found yesterday, and it was an oversight
in PyRun_SimpleFile. There I call the _nr version, which actually
doesn't execute its code but returns a Py_UnwindToken.
I always felt that I've overdone here, but it was simple to solve.
I just had to repeat the errorprint code, and it works.
In other words, the program just misses to print the error,
everything else is fine. I didn't update the source since
I'm again making a huge change, Version 0.4 this week. This
one solves all continuation problems which can occour, and
the final goal (continuationmodule.c) is going to become public.

Here the patch:

pythonrun.c must be changed this way, from line 548 on:
--------------------------------------------------------
int
PyRun_SimpleFile(fp, filename)
	FILE *fp;
	char *filename;
{
	int retval;
	PyObject * result = PyRun_SimpleFile_nr(fp, filename);
	if (result == Py_UnwindToken) {
		result = PyEval_Frame_Dispatch();
		/* proper handling added 990714 */
		if (result == NULL)
			PyErr_Print();
		if (Py_FlushLine())
			PyErr_Clear();
	}
	if (result==NULL)
		retval = -1;
	else
		retval = 0;
	Py_XDECREF(result);
	return retval;
}
--------------------------------------------------------
> 
> As you can see I have built stackless python into an executable called
> stackless-python. This required extensive hackery of the build process, so
> that could be at fault. This makes even less sense to me.

Really so hard? I thought you can rename it when it's ready,
just in the install case?

> A consequence of all this is that stackless-python cannot install itself
> without error on my system (compileall.py "fails").

> PS: Did you see stackless python got a mention on Linux Weekly News Today?
> Cool.

Oh, they did it again?
What will they say when I claim full blown first
class continuations for python, next week? :-))

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101   :    *Starship* http://starship.python.net
10553 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     we're tired of banana software - shipped green, ripens at home




More information about the Python-list mailing list