diff options
-rw-r--r-- | src/mapi/glapi/gen/gl_XML.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py index 334fd6e683..34f987ee3b 100644 --- a/src/mapi/glapi/gen/gl_XML.py +++ b/src/mapi/glapi/gen/gl_XML.py @@ -66,15 +66,13 @@ def is_attr_true(element, name, default="false"): The value read from the attribute list must be either 'true' or 'false'. If the value is 'false', zero will be returned. If the value is 'true', non-zero will be returned. An exception will be - raised for any other value.""" + raised for any other value. + """ value = element.get(name, default) - if value == "true": - return 1 - elif value == "false": - return 0 - else: - raise RuntimeError('Invalid value "%s" for boolean "%s".' % (value, name)) + assert value in ('true', 'false'), 'value {} was not a bool'.format(value) + + return value == 'true' class gl_print_base(object): |