Mercurial > cpython-lru_cache-weakref
comparison Python/ceval.c @ 5438:e926c331ebbf legacy-trunk
Instead of importing graminit.h whenever one of the three grammar 'root'
symbols is needed, define these in Python.h with a Py_ prefix.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 07 May 1997 17:46:13 +0000 |
| parents | 10267fdc7531 |
| children | af1aea6b968f |
comparison
equal
deleted
inserted
replaced
| 5437:c2dae2b1a123 | 5438:e926c331ebbf |
|---|---|
| 41 | 41 |
| 42 #include "compile.h" | 42 #include "compile.h" |
| 43 #include "frameobject.h" | 43 #include "frameobject.h" |
| 44 #include "eval.h" | 44 #include "eval.h" |
| 45 #include "opcode.h" | 45 #include "opcode.h" |
| 46 #include "graminit.h" | |
| 47 | 46 |
| 48 #include <ctype.h> | 47 #include <ctype.h> |
| 49 | 48 |
| 50 #ifdef HAVE_LIMITS_H | 49 #ifdef HAVE_LIMITS_H |
| 51 #include <limits.h> | 50 #include <limits.h> |
| 2635 return 0; | 2634 return 0; |
| 2636 } | 2635 } |
| 2637 if (PyFile_Check(prog)) { | 2636 if (PyFile_Check(prog)) { |
| 2638 FILE *fp = PyFile_AsFile(prog); | 2637 FILE *fp = PyFile_AsFile(prog); |
| 2639 char *name = PyString_AsString(PyFile_Name(prog)); | 2638 char *name = PyString_AsString(PyFile_Name(prog)); |
| 2640 if (PyRun_File(fp, name, file_input, globals, locals) == NULL) | 2639 if (PyRun_File(fp, name, Py_file_input, |
| 2640 globals, locals) == NULL) | |
| 2641 return -1; | 2641 return -1; |
| 2642 return 0; | 2642 return 0; |
| 2643 } | 2643 } |
| 2644 s = PyString_AsString(prog); | 2644 s = PyString_AsString(prog); |
| 2645 if (strlen(s) != PyString_Size(prog)) { | 2645 if (strlen(s) != PyString_Size(prog)) { |
| 2646 PyErr_SetString(PyExc_ValueError, | 2646 PyErr_SetString(PyExc_ValueError, |
| 2647 "embedded '\\0' in exec string"); | 2647 "embedded '\\0' in exec string"); |
| 2648 return -1; | 2648 return -1; |
| 2649 } | 2649 } |
| 2650 v = PyRun_String(s, file_input, globals, locals); | 2650 v = PyRun_String(s, Py_file_input, globals, locals); |
| 2651 if (v == NULL) | 2651 if (v == NULL) |
| 2652 return -1; | 2652 return -1; |
| 2653 Py_DECREF(v); | 2653 Py_DECREF(v); |
| 2654 if (plain) | 2654 if (plain) |
| 2655 PyFrame_LocalsToFast(f, 0); | 2655 PyFrame_LocalsToFast(f, 0); |
