glib-mkenums: Don't use FileNotFoundError, it's Python 3 only.

https://bugzilla.gnome.org/show_bug.cgi?id=785113
This commit is contained in:
Christoph Reiter 2017-07-19 11:49:04 +02:00
parent c2dace6b8b
commit d88d1ba7e8

View File

@ -15,6 +15,7 @@ import re
import sys
import tempfile
import io
import errno
VERSION_STR = '''glib-mkenums version @VERSION@
glib-genmarshal comes with ABSOLUTELY NO WARRANTY.
@ -399,9 +400,11 @@ def process_file(curfilename):
try:
curfile = io.open(curfilename, encoding="utf-8")
except FileNotFoundError:
print_warning('No file "{}" found.'.format(curfilename))
return
except IOError as e:
if e.errno == errno.ENOENT:
print_warning('No file "{}" found.'.format(curfilename))
return
raise
while True:
line = curfile.readline()