[Python-checkins] CVS: python/dist/src/Python compile.c,2.182,2.183
Jeremy Hylton
jhylton@users.sourceforge.net
Wed, 28 Feb 2001 16:42:57 -0800
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv24539/Python
Modified Files:
compile.c
Log Message:
Don't add global names to st->st_global if we're already iterating
over the elements of st->st_global!
Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.182
retrieving revision 2.183
diff -C2 -r2.182 -r2.183
*** compile.c 2001/02/28 23:47:55 2.182
--- compile.c 2001/03/01 00:42:55 2.183
***************
*** 3976,3983 ****
char buf[350];
sprintf(buf,
! "unknown scope for %.100s in %.100s(%s) in %s",
name, c->c_name,
PyObject_REPR(c->c_symtable->st_cur->ste_id),
! c->c_filename);
Py_FatalError(buf);
}
--- 3976,3989 ----
char buf[350];
sprintf(buf,
! "unknown scope for %.100s in %.100s(%s) "
! "in %s\nsymbols: %s\nlocals: %s\nglobals: %s\n",
name, c->c_name,
PyObject_REPR(c->c_symtable->st_cur->ste_id),
! c->c_filename,
! PyObject_REPR(c->c_symtable->st_cur->ste_symbols),
! PyObject_REPR(c->c_locals),
! PyObject_REPR(c->c_globals)
! );
!
Py_FatalError(buf);
}
***************
*** 4330,4338 ****
if (PyDict_SetItem(c->c_globals, name,
implicit) < 0)
- goto fail;
- v = PyInt_FromLong(flags);
- if (PyDict_SetItem(st->st_global, name, v))
goto fail;
! Py_DECREF(v);
}
}
--- 4336,4347 ----
if (PyDict_SetItem(c->c_globals, name,
implicit) < 0)
goto fail;
! if (st->st_nscopes != 1) {
! v = PyInt_FromLong(flags);
! if (PyDict_SetItem(st->st_global,
! name, v))
! goto fail;
! Py_DECREF(v);
! }
}
}