diff options
author | Kenneth Graunke <[email protected]> | 2018-05-07 11:23:27 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2018-05-07 23:06:52 -0700 |
commit | 33906eeaca917506cfa4297913c386121357531e (patch) | |
tree | cbd42398034ecaa7f5724108f6c4b50512c66cd8 /src | |
parent | 2dc29e095f9daffd9da722919fa08ca912ab8f04 (diff) |
intel/genxml: Make assert in gen_pack_header print a message.
Python's assert can take both a condition and a string, which will cause
it to print the string if the assertion trips. (You can't use parens as
that creates a tuple.) Doing "condition and string" works in C, but
doesn't have the desired effect in Python.
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/genxml/gen_pack_header.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/intel/genxml/gen_pack_header.py b/src/intel/genxml/gen_pack_header.py index 6a4c8033a70..4bce425d12e 100644 --- a/src/intel/genxml/gen_pack_header.py +++ b/src/intel/genxml/gen_pack_header.py @@ -220,7 +220,7 @@ def num_from_str(num_str): if num_str.lower().startswith('0x'): return int(num_str, base=16) else: - assert(not num_str.startswith('0') and 'octals numbers not allowed') + assert not num_str.startswith('0'), 'octals numbers not allowed' return int(num_str) class Field(object): |