[Python-Dev] Weird message to stderr

Guido van Rossum guido@digicool.com
Wed, 13 Jun 2001 13:01:34 -0400


> Running Python 2.1 using a .pyc file I get these weird messages
> printed to stderr:
> 
> run_pyc_file: nested_scopes: 0
> 
> These originate in pythonrun.c:
> 
> static PyObject *
> run_pyc_file(FILE *fp, char *filename, PyObject *globals, PyObject *locals,
> 	     PyCompilerFlags *flags)
> {
[...]
> 	if (v && flags) {
> 		if (co->co_flags & CO_NESTED)
> 			flags->cf_nested_scopes = 1;
> 		fprintf(stderr, "run_pyc_file: nested_scopes: %d\n",
> 			flags->cf_nested_scopes);			
> 	}
> 	Py_DECREF(co);
> 	return v;
> }
> 
> Is this is left over debug printf or should I be warned
> in some way ?

I'll channel Jeremy...

Looks like a debug message -- this code isn't tested by the standard
test suite.  Feel free to get rid of the fprintf() statement (and no,
you don't have to write a PEP for this :-).

--Guido van Rossum (home page: http://www.python.org/~guido/)