freedreno/registers: Fix gen_header.py for older python3 versions
The gen_header.py script is failing for older versions of python3 such
as python 3.5. Two issues observed with python 3.5 are ...
1. Python 3 versions prior to 3.6 do not support the f-string format.
2. Early python 3 versions do not support the 'required' argument for
the argparse add_subparsers().
Fix both of the above so that older versions of python 3 still work.
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28780>
This commit is contained in:
@@ -322,7 +322,7 @@ class Array(object):
|
||||
indices = []
|
||||
if self.length != 1:
|
||||
if self.fixed_offsets:
|
||||
indices.append((self.index_ctype(), None, f"__offset_{self.local_name}"))
|
||||
indices.append((self.index_ctype(), None, "__offset_%s" % self.local_name))
|
||||
else:
|
||||
indices.append((self.index_ctype(), self.stride, None))
|
||||
return indices
|
||||
@@ -962,7 +962,8 @@ def main():
|
||||
parser.add_argument('--xml', type=str, required=True)
|
||||
parser.add_argument('--validate', action=argparse.BooleanOptionalAction)
|
||||
|
||||
subparsers = parser.add_subparsers(required=True)
|
||||
subparsers = parser.add_subparsers()
|
||||
subparsers.required = True
|
||||
|
||||
parser_c_defines = subparsers.add_parser('c-defines')
|
||||
parser_c_defines.set_defaults(func=dump_c_defines)
|
||||
|
||||
Reference in New Issue
Block a user