[glib] glib-mkenums: Don't use FileNotFoundError, it's Python 3 only.
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] glib-mkenums: Don't use FileNotFoundError, it's Python 3 only.
- Date: Wed, 19 Jul 2017 12:22:30 +0000 (UTC)
commit d88d1ba7e844b5493a53dfcdba77d4df3ea1684d
Author: Christoph Reiter <creiter src gnome org>
Date: Wed Jul 19 11:49:04 2017 +0200
glib-mkenums: Don't use FileNotFoundError, it's Python 3 only.
https://bugzilla.gnome.org/show_bug.cgi?id=785113
gobject/glib-mkenums.in | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in
index e22b317..653a769 100755
--- a/gobject/glib-mkenums.in
+++ b/gobject/glib-mkenums.in
@@ -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()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]