mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
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:
parent
c2dace6b8b
commit
d88d1ba7e8
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user