blob: 70abd263da1c38be8a4a9590da5b0bed398878c1 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From c0ba116eab401431b4f11b66bd7d1b42741b03c3 Mon Sep 17 00:00:00 2001
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002From: Jason Wessel <jason.wessel@windriver.com>
3Date: Thu, 29 Jun 2017 20:33:23 -0700
Brad Bishop316dfdd2018-06-25 12:45:53 -04004Subject: [PATCH] Python3 compatibility: exception cleanup
Brad Bishopd7bf8c12018-02-25 22:55:05 -05005
6Commit 52e4a477f0b3c0a0ece7adeede6e06e07814f8b9 from
7https://github.com/openvswitch/ovs.git
8
9The exception syntax which is compatible with python2 and python3 is
10to use the "as" form for "except:".
11
12Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
13Signed-off-by: Ben Pfaff <blp@ovn.org>
Brad Bishop316dfdd2018-06-25 12:45:53 -040014
Brad Bishopd7bf8c12018-02-25 22:55:05 -050015---
16 build-aux/extract-ofp-fields | 2 +-
17 ovsdb/ovsdb-doc | 4 ++--
18 ovsdb/ovsdb-idlc.in | 4 ++--
19 3 files changed, 5 insertions(+), 5 deletions(-)
20
21diff --git a/build-aux/extract-ofp-fields b/build-aux/extract-ofp-fields
Brad Bishop316dfdd2018-06-25 12:45:53 -040022index 80c7d35..6286c9c 100755
Brad Bishopd7bf8c12018-02-25 22:55:05 -050023--- a/build-aux/extract-ofp-fields
24+++ b/build-aux/extract-ofp-fields
25@@ -784,7 +784,7 @@ if __name__ == "__main__":
26 try:
27 options, args = getopt.gnu_getopt(sys.argv[1:], 'h',
28 ['help', 'ovs-version='])
29- except getopt.GetoptError, geo:
30+ except getopt.GetoptError as geo:
31 sys.stderr.write("%s: %s\n" % (argv0, geo.msg))
32 sys.exit(1)
33
34diff --git a/ovsdb/ovsdb-doc b/ovsdb/ovsdb-doc
Brad Bishop316dfdd2018-06-25 12:45:53 -040035index e82ad59..9448713 100755
Brad Bishopd7bf8c12018-02-25 22:55:05 -050036--- a/ovsdb/ovsdb-doc
37+++ b/ovsdb/ovsdb-doc
38@@ -278,7 +278,7 @@ if __name__ == "__main__":
39 options, args = getopt.gnu_getopt(sys.argv[1:], 'hV',
40 ['er-diagram=',
41 'version=', 'help'])
42- except getopt.GetoptError, geo:
43+ except getopt.GetoptError as geo:
44 sys.stderr.write("%s: %s\n" % (argv0, geo.msg))
45 sys.exit(1)
46
47@@ -306,7 +306,7 @@ if __name__ == "__main__":
48 if len(line):
49 print(line)
50
51- except error.Error, e:
52+ except error.Error as e:
53 sys.stderr.write("%s: %s\n" % (argv0, e.msg))
54 sys.exit(1)
55
56diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
Brad Bishop316dfdd2018-06-25 12:45:53 -040057index 62442ee..e7e1c6b 100755
Brad Bishopd7bf8c12018-02-25 22:55:05 -050058--- a/ovsdb/ovsdb-idlc.in
59+++ b/ovsdb/ovsdb-idlc.in
60@@ -1098,7 +1098,7 @@ if __name__ == "__main__":
61 ['directory',
62 'help',
63 'version'])
64- except getopt.GetoptError, geo:
65+ except getopt.GetoptError as geo:
66 sys.stderr.write("%s: %s\n" % (argv0, geo.msg))
67 sys.exit(1)
68
69@@ -1136,7 +1136,7 @@ if __name__ == "__main__":
70 sys.exit(1)
71
72 func(*args[1:])
73- except ovs.db.error.Error, e:
74+ except ovs.db.error.Error as e:
75 sys.stderr.write("%s: %s\n" % (argv0, e))
76 sys.exit(1)
77