mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 23:46:17 +01:00
glib-genmarshal: close output file
Close output file to ensure all buffered output actually gets written. Otherwise, glib-genmarshal output is sometimes empty (for example, when trying to build gdk-pixbuf on Windows, with Meson installed from .msi package). argparse.FileType doesn't get closed automagically when the script exits: https://bugs.python.org/issue13824 Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2341
This commit is contained in:
parent
14c9fc79ac
commit
f346b9c8ce
@ -864,7 +864,7 @@ def generate_marshallers_body(outfile, retval, params,
|
|||||||
outfile.write('\n\n')
|
outfile.write('\n\n')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def parse_args():
|
||||||
arg_parser = argparse.ArgumentParser(description='Generate signal marshallers for GObject')
|
arg_parser = argparse.ArgumentParser(description='Generate signal marshallers for GObject')
|
||||||
arg_parser.add_argument('--prefix', metavar='STRING',
|
arg_parser.add_argument('--prefix', metavar='STRING',
|
||||||
default='g_cclosure_user_marshal',
|
default='g_cclosure_user_marshal',
|
||||||
@ -945,6 +945,10 @@ if __name__ == '__main__':
|
|||||||
print(VERSION_STR)
|
print(VERSION_STR)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
return args
|
||||||
|
|
||||||
|
|
||||||
|
def generate(args):
|
||||||
# Backward compatibility hack; some projects use both arguments to
|
# Backward compatibility hack; some projects use both arguments to
|
||||||
# generate the marshallers prototype in the C source, even though
|
# generate the marshallers prototype in the C source, even though
|
||||||
# it's not really a supported use case. We keep this behaviour by
|
# it's not really a supported use case. We keep this behaviour by
|
||||||
@ -1067,3 +1071,10 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
if args.header:
|
if args.header:
|
||||||
generate_header_postamble(args.output, prefix=args.prefix, use_pragma=args.pragma_once)
|
generate_header_postamble(args.output, prefix=args.prefix, use_pragma=args.pragma_once)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
args = parse_args()
|
||||||
|
|
||||||
|
with args.output:
|
||||||
|
generate(args)
|
||||||
|
Loading…
Reference in New Issue
Block a user