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.
This commit is contained in:
Emmanuele Bassi 2017-07-17 10:24:32 +01:00
parent 77a3a96218
commit 69515e9f5c

View File

@ -348,7 +348,13 @@ if len(fhead) > 0:
def process_file(curfilename):
global entries, flags, seenbitshift, enum_prefix
firstenum = True
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):