Message ID | 20180222103041.8046-4-mchandras@suse.de |
---|---|
State | Accepted |
Headers | show |
Series | ovsdb-dot python3 fixes | expand |
diff --git a/ovsdb/ovsdb-dot.in b/ovsdb/ovsdb-dot.in index 7f846836d..43c50dabd 100755 --- a/ovsdb/ovsdb-dot.in +++ b/ovsdb/ovsdb-dot.in @@ -81,7 +81,7 @@ if __name__ == "__main__": options, args = getopt.gnu_getopt(sys.argv[1:], 'hV', ['no-arrows', 'help', 'version',]) - except getopt.GetoptError, geo: + except getopt.GetoptError as geo: sys.stderr.write("%s: %s\n" % (argv0, geo.msg)) sys.exit(1) @@ -103,7 +103,7 @@ if __name__ == "__main__": schemaToDot(args[0], arrows) - except ovs.db.error.Error, e: + except ovs.db.error.Error as e: sys.stderr.write("%s: %s\n" % (argv0, e.msg)) sys.exit(1)
PEP-3110 changes the semantics for capturing exceptions in Python3 from 'except E,N' to 'except E as N'. This fixes the following problem when building with python3 SyntaxError: invalid syntax File "./ovsdb/ovsdb-dot.in", line 106 except ovs.db.error.Error, e: ^ SyntaxError: invalid syntax Link: https://www.python.org/dev/peps/pep-3110/ Signed-off-by: Markos Chandras <mchandras@suse.de> --- ovsdb/ovsdb-dot.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)