summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-05-07 17:46:13 (GMT)
committerGuido van Rossum <guido@python.org>1997-05-07 17:46:13 (GMT)
commitb05a5c7698cd8dff3e5c02e513db765ba12281f0 (patch)
tree86831a79ad6434c88c57ed7cc730cfcd66c3554c /Python/bltinmodule.c
parent8813b58ffa6d83522ad2bbec0437c5c0e52a7ba9 (diff)
downloadcpython-b05a5c7698cd8dff3e5c02e513db765ba12281f0.zip
cpython-b05a5c7698cd8dff3e5c02e513db765ba12281f0.tar.gz
cpython-b05a5c7698cd8dff3e5c02e513db765ba12281f0.tar.bz2
Instead of importing graminit.h whenever one of the three grammar 'root'
symbols is needed, define these in Python.h with a Py_ prefix.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 2461904..7c46286 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -34,7 +34,6 @@ PERFORMANCE OF THIS SOFTWARE.
#include "Python.h"
#include "node.h"
-#include "graminit.h"
#include "compile.h"
#include "eval.h"
@@ -283,11 +282,11 @@ builtin_compile(self, args)
if (!PyArg_ParseTuple(args, "sss:compile", &str, &filename, &startstr))
return NULL;
if (strcmp(startstr, "exec") == 0)
- start = file_input;
+ start = Py_file_input;
else if (strcmp(startstr, "eval") == 0)
- start = eval_input;
+ start = Py_eval_input;
else if (strcmp(startstr, "single") == 0)
- start = single_input;
+ start = Py_single_input;
else {
PyErr_SetString(PyExc_ValueError,
"compile() mode must be 'exec' or 'eval' or 'single'");
@@ -521,7 +520,7 @@ builtin_eval(self, args)
}
while (*str == ' ' || *str == '\t')
str++;
- return PyRun_String(str, eval_input, globals, locals);
+ return PyRun_String(str, Py_eval_input, globals, locals);
}
static PyObject *
@@ -558,7 +557,7 @@ builtin_execfile(self, args)
PyErr_SetFromErrno(PyExc_IOError);
return NULL;
}
- res = PyRun_File(fp, filename, file_input, globals, locals);
+ res = PyRun_File(fp, filename, Py_file_input, globals, locals);
Py_BEGIN_ALLOW_THREADS
fclose(fp);
Py_END_ALLOW_THREADS
@@ -882,7 +881,7 @@ builtin_input(self, args)
PyEval_GetBuiltins()) != 0)
return NULL;
}
- res = PyRun_String(str, eval_input, globals, locals);
+ res = PyRun_String(str, Py_eval_input, globals, locals);
Py_DECREF(line);
return res;
}