diff options
author | Mauro Carvalho Chehab <mchehab@kernel.org> | 2024-03-13 08:56:07 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2024-03-14 06:05:09 +0100 |
commit | 57dc89eb9ed98e62ec744bca6f639fdad355f23f (patch) | |
tree | 40acbb6d87647e19ef71be5f14301280a8aaf58b /scripts | |
parent | 2507b4a3ed35027e9676e38ae2519fd5d617178a (diff) |
scripts/xls_to_doc.py: fix issues with python < 3.7
The current logic relies on dict = sorted(dict) to preserve the
sorted order. Ordered dicts were introduced only on python 3.7.
This is a silly requirement, as all we want is to sort the
dict.item() tuple. Change the logic to avoid the need of
checking for an specific python version.
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Reviewed-by: Katarzyna Piecielska <katarzyna.piecielska@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/xls_to_doc.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/xls_to_doc.py b/scripts/xls_to_doc.py index 7ea92a344..cf2cfe2fe 100755 --- a/scripts/xls_to_doc.py +++ b/scripts/xls_to_doc.py @@ -17,6 +17,7 @@ from openpyxl import load_workbook from test_list import TestList + # # FillTests class definition # @@ -127,7 +128,7 @@ class FillTests(TestList): self.process_spreadsheet_sheet(sheet) - return dict(sorted(self.spreadsheet_data.items())) + return self.spreadsheet_data def change_value(self, content, subtest, line, field, value): @@ -190,7 +191,7 @@ class FillTests(TestList): data = self.read_spreadsheet_file(fname, sheets) - for test, row in data.items(): + for test, row in sorted(data.items()): match = self.testname_regex.match(test) if not match: sys.exit(f"Error: can't parse {test}") |