comparison Python/Python-ast.c @ 40588:4bab65fcca8e

Some more changes related to the new except syntax and semantics, by Collin Winter.
author Guido van Rossum <guido@python.org>
date Wed, 10 Jan 2007 18:51:35 +0000
parents 6bd65cb5b952
children 47f9efdc0855
comparison
equal deleted inserted replaced
40587:6b18a095c2e7 40588:4bab65fcca8e
1834 p->ifs = ifs; 1834 p->ifs = ifs;
1835 return p; 1835 return p;
1836 } 1836 }
1837 1837
1838 excepthandler_ty 1838 excepthandler_ty
1839 excepthandler(expr_ty type, expr_ty name, asdl_seq * body, int lineno, int 1839 excepthandler(expr_ty type, identifier name, asdl_seq * body, int lineno, int
1840 col_offset, PyArena *arena) 1840 col_offset, PyArena *arena)
1841 { 1841 {
1842 excepthandler_ty p; 1842 excepthandler_ty p;
1843 p = (excepthandler_ty)PyArena_Malloc(arena, sizeof(*p)); 1843 p = (excepthandler_ty)PyArena_Malloc(arena, sizeof(*p));
1844 if (!p) { 1844 if (!p) {
2926 value = ast2obj_expr(o->type); 2926 value = ast2obj_expr(o->type);
2927 if (!value) goto failed; 2927 if (!value) goto failed;
2928 if (PyObject_SetAttrString(result, "type", value) == -1) 2928 if (PyObject_SetAttrString(result, "type", value) == -1)
2929 goto failed; 2929 goto failed;
2930 Py_DECREF(value); 2930 Py_DECREF(value);
2931 value = ast2obj_expr(o->name); 2931 value = ast2obj_identifier(o->name);
2932 if (!value) goto failed; 2932 if (!value) goto failed;
2933 if (PyObject_SetAttrString(result, "name", value) == -1) 2933 if (PyObject_SetAttrString(result, "name", value) == -1)
2934 goto failed; 2934 goto failed;
2935 Py_DECREF(value); 2935 Py_DECREF(value);
2936 value = ast2obj_list(o->body, ast2obj_stmt); 2936 value = ast2obj_list(o->body, ast2obj_stmt);