mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-14 09:53:12 +02: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 sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import io
|
import io
|
||||||
|
import errno
|
||||||
|
|
||||||
VERSION_STR = '''glib-mkenums version @VERSION@
|
VERSION_STR = '''glib-mkenums version @VERSION@
|
||||||
glib-genmarshal comes with ABSOLUTELY NO WARRANTY.
|
glib-genmarshal comes with ABSOLUTELY NO WARRANTY.
|
||||||
@ -399,9 +400,11 @@ def process_file(curfilename):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
curfile = io.open(curfilename, encoding="utf-8")
|
curfile = io.open(curfilename, encoding="utf-8")
|
||||||
except FileNotFoundError:
|
except IOError as e:
|
||||||
|
if e.errno == errno.ENOENT:
|
||||||
print_warning('No file "{}" found.'.format(curfilename))
|
print_warning('No file "{}" found.'.format(curfilename))
|
||||||
return
|
return
|
||||||
|
raise
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
line = curfile.readline()
|
line = curfile.readline()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user