Skip to content

Commit

Permalink
ovsdb: ovsdb-dot.in: Change exception semantics for Python3
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
Markos Chandras authored and blp committed Jan 9, 2018
1 parent 6add8d7 commit 9a0dbc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ovsdb/ovsdb-dot.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down

0 comments on commit 9a0dbc7

Please sign in to comment.