meson: fix compatibility with Python 3.7
[8/2759] Generating src/basic/filesystem-sets.c with a custom command (wrapped by meson to capture output)
FAILED: src/basic/filesystem-sets.c
/mnt/work/.local/bin/meson --internal exe --capture src/basic/filesystem-sets.c -- /mnt/work/src/systemd/upstream-fork/main/src/basic/filesystem-sets.py fs-type-to-string filesystem-sets fs-in-group
--- stderr ---
Traceback (most recent call last):
File "/mnt/work/src/systemd/upstream-fork/main/src/basic/filesystem-sets.py", line 372, in <module>
generate_fs_in_group()
File "/mnt/work/src/systemd/upstream-fork/main/src/basic/filesystem-sets.py", line 311, in generate_fs_in_group
start=[])))
TypeError: sum() takes no keyword arguments
This commit is contained in:
@@ -307,8 +307,7 @@ def generate_fs_in_group():
|
||||
print(' switch (fs_group) {')
|
||||
|
||||
for name, _, *filesystems in FILESYSTEM_SETS:
|
||||
magics = sorted(set(sum((NAME_TO_MAGIC[fs] for fs in filesystems),
|
||||
start=[])))
|
||||
magics = sorted(set(sum((NAME_TO_MAGIC[fs] for fs in filesystems), [])))
|
||||
enum = 'FILESYSTEM_SET_' + name[1:].upper().replace('-', '_')
|
||||
print(f' case {enum}:')
|
||||
opts = '\n || '.join(f'F_TYPE_EQUAL(st->f_type, {magic})'
|
||||
@@ -355,7 +354,7 @@ def magic_defines():
|
||||
|
||||
def check():
|
||||
kernel_magics = set(magic_defines())
|
||||
our_magics = set(sum(NAME_TO_MAGIC.values(), start=[]))
|
||||
our_magics = set(sum(NAME_TO_MAGIC.values(), []))
|
||||
extra = kernel_magics - our_magics
|
||||
if extra:
|
||||
sys.exit(f"kernel knows additional filesystem magics: {', '.join(sorted(extra))}")
|
||||
|
||||
Reference in New Issue
Block a user