summaryrefslogtreecommitdiffstats
path: root/Parser/asdl_c.py
diff options
context:
space:
mode:
Diffstat (limited to 'Parser/asdl_c.py')
-rwxr-xr-xParser/asdl_c.py2
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)