From 69515e9f5c43046e673e8751e3703703cd41e540 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 17 Jul 2017 10:24:32 +0100 Subject: [PATCH] mkenums: Skip files not found The old glib-mkenums was more forgiving, and simply ignored any files it could not find. We're going to print a warning, as in the future we may want to allow more strictness. --- gobject/glib-mkenums.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in index cff0da3b1..c59d17cee 100755 --- a/gobject/glib-mkenums.in +++ b/gobject/glib-mkenums.in @@ -348,7 +348,13 @@ if len(fhead) > 0: def process_file(curfilename): global entries, flags, seenbitshift, enum_prefix firstenum = True - curfile = open(curfilename) + + try: + curfile = open(curfilename) + except FileNotFoundError: + sys.stderr.write('WARNING: No file "{}" found.'.format(curfilename)) + return + for line in curfile: # read lines until we have no open comments while re.search(r'/\*([^*]|\*(?!/))*$', line):