diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2006-04-04 04:00:23 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2006-04-04 04:00:23 (GMT) |
commit | 2f327c14eb998e8796a3775aa6a7aade14e97004 (patch) | |
tree | 3de98142ca2b873c0cfb25f630c7dda2d90f96fa /Parser/asdl_c.py | |
parent | cb30f97bd3bdea2e884e8faec23751b39db4c0b3 (diff) | |
download | cpython-2f327c14eb998e8796a3775aa6a7aade14e97004.zip cpython-2f327c14eb998e8796a3775aa6a7aade14e97004.tar.gz cpython-2f327c14eb998e8796a3775aa6a7aade14e97004.tar.bz2 |
Add lineno, col_offset to excephandler to enable future fix for
tracing/line number table in except blocks.
Reflow long lines introduced by col_offset changes. Update test_ast
to handle new fields in excepthandler.
As note in Python.asdl says, we might want to rethink how attributes
are handled. Perhaps they should be the same as other fields, with
the primary difference being how they are defined for all types within
a sum.
Also fix asdl_c so that constructors with int fields don't fail when
passed a zero value.
Diffstat (limited to 'Parser/asdl_c.py')
-rwxr-xr-x | Parser/asdl_c.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index bc59c38..5bb42ec 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -276,7 +276,7 @@ class FunctionVisitor(PrototypeVisitor): emit("%s p;" % ctype, 1) for argtype, argname, opt in args: # XXX hack alert: false is allowed for a bool - if not opt and not argtype == "bool": + if not opt and not (argtype == "bool" or argtype == "int"): emit("if (!%s) {" % argname, 1) emit("PyErr_SetString(PyExc_ValueError,", 2) msg = "field %s is required for %s" % (argname, name) |