mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-09-20 01:06:15 +02:00
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:
parent
77a3a96218
commit
69515e9f5c
@ -348,7 +348,13 @@ if len(fhead) > 0:
|
|||||||
def process_file(curfilename):
|
def process_file(curfilename):
|
||||||
global entries, flags, seenbitshift, enum_prefix
|
global entries, flags, seenbitshift, enum_prefix
|
||||||
firstenum = True
|
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:
|
for line in curfile:
|
||||||
# read lines until we have no open comments
|
# read lines until we have no open comments
|
||||||
while re.search(r'/\*([^*]|\*(?!/))*$', line):
|
while re.search(r'/\*([^*]|\*(?!/))*$', line):
|
||||||
|
Loading…
Reference in New Issue
Block a user