Undo recent change that banned using import to bind a global, as per

discussion on python-dev.  'from mod import *' is still banned except
at the module level.

Fix value for special NOOPT entry in symtable.  Initialze to 0 instead
of None, so that later uses of PyInt_AS_LONG() are valid.  (Bug
reported by Donn Cave.)

replace local REPR macros with PyObject_REPR in object.h
This commit is contained in:
Jeremy Hylton 2001-02-01 20:20:45 +00:00
parent fb9d712721
commit 483638c9a8
5 changed files with 31 additions and 29 deletions

View file

@ -31,8 +31,6 @@
typedef PyObject *(*callproc)(PyObject *, PyObject *, PyObject *);
#define REPR(ob) PyString_AS_STRING(PyObject_Repr(ob))
/* Forward declarations */
static PyObject *eval_code2(PyCodeObject *,
@ -1456,7 +1454,7 @@ eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals,
if ((x = f->f_locals) == NULL) {
PyErr_Format(PyExc_SystemError,
"no locals found when storing %s",
REPR(w));
PyObject_REPR(w));
break;
}
err = PyDict_SetItem(x, w, v);
@ -1468,7 +1466,7 @@ eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals,
if ((x = f->f_locals) == NULL) {
PyErr_Format(PyExc_SystemError,
"no locals when deleting %s",
REPR(w));
PyObject_REPR(w));
break;
}
if ((err = PyDict_DelItem(x, w)) != 0)
@ -1563,7 +1561,7 @@ eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals,
if ((x = f->f_locals) == NULL) {
PyErr_Format(PyExc_SystemError,
"no locals when loading %s",
REPR(w));
PyObject_REPR(w));
break;
}
x = PyDict_GetItem(x, w);