Mercurial > cpython-lru_cache-weakref
comparison Python/Python-ast.c @ 80837:a9341ce35abc 2.7
Make PyAST_obj2mod C89 compliant. (Follow-up commit from asdl_c.py.)
| author | Trent Nelson <trent@trent.me> |
|---|---|
| date | Thu, 13 Dec 2012 07:22:16 +0000 |
| parents | 7a72068d88fe |
| children |
comparison
equal
deleted
inserted
replaced
| 80836:0cd6b8005890 | 80837:a9341ce35abc |
|---|---|
| 6747 | 6747 |
| 6748 /* mode is 0 for "exec", 1 for "eval" and 2 for "single" input */ | 6748 /* mode is 0 for "exec", 1 for "eval" and 2 for "single" input */ |
| 6749 mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) | 6749 mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) |
| 6750 { | 6750 { |
| 6751 mod_ty res; | 6751 mod_ty res; |
| 6752 PyObject *req_type[] = {(PyObject*)Module_type, (PyObject*)Expression_type, | 6752 PyObject *req_type[3]; |
| 6753 (PyObject*)Interactive_type}; | 6753 char *req_name[3]; |
| 6754 char *req_name[] = {"Module", "Expression", "Interactive"}; | |
| 6755 int isinstance; | 6754 int isinstance; |
| 6755 | |
| 6756 req_type[0] = (PyObject*)Module_type; | |
| 6757 req_type[1] = (PyObject*)Expression_type; | |
| 6758 req_type[2] = (PyObject*)Interactive_type; | |
| 6759 | |
| 6760 req_name[0] = "Module"; | |
| 6761 req_name[1] = "Expression"; | |
| 6762 req_name[2] = "Interactive"; | |
| 6763 | |
| 6756 assert(0 <= mode && mode <= 2); | 6764 assert(0 <= mode && mode <= 2); |
| 6757 | 6765 |
| 6758 init_types(); | 6766 init_types(); |
| 6759 | 6767 |
| 6760 isinstance = PyObject_IsInstance(ast, req_type[mode]); | 6768 isinstance = PyObject_IsInstance(ast, req_type[mode]); |
