1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-29 21:55:36 +03:00

generate-sys-test: modernize Python and C code

Meson itself requires Python 3.6, which has f-strings. So I think it's fine to
use them here too. I wanted to use walrus for 'if m:= re.search(...)', but that'd
require 3.8.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-01-27 12:03:57 +01:00
parent 0fcd9f213e
commit 7857b6e838

View File

@ -16,15 +16,14 @@ for line in open(sys.argv[1]):
if match:
s = match.group(1)
if s == 'sd_bus_object_vtable_format':
print(' &{},'.format(s))
print(f' &{s},')
else:
print(' {},'.format(s))
print(f' {s},')
print('''};
int main(void) {
unsigned i;
for (i = 0; i < sizeof(symbols)/sizeof(void*); i++)
for (size_t i = 0; i < sizeof(symbols)/sizeof(void*); i++)
printf("%p\\n", symbols[i]);
return 0;
}''')