Skip to content

Commit

Permalink
Python3 compatibility: exception cleanup
Browse files Browse the repository at this point in the history
The exception syntax which is compatible with python2 and python3 is
to use the "as" form for "except:".

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
jwessel authored and blp committed Jul 6, 2017
1 parent d34a1cc commit 52e4a47
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build-aux/extract-ofp-fields
Expand Up @@ -787,7 +787,7 @@ if __name__ == "__main__":
try:
options, args = getopt.gnu_getopt(sys.argv[1:], 'h',
['help', 'ovs-version='])
except getopt.GetoptError, geo:
except getopt.GetoptError as geo:
sys.stderr.write("%s: %s\n" % (argv0, geo.msg))
sys.exit(1)

Expand Down
4 changes: 2 additions & 2 deletions ovsdb/ovsdb-doc
Expand Up @@ -278,7 +278,7 @@ if __name__ == "__main__":
options, args = getopt.gnu_getopt(sys.argv[1:], 'hV',
['er-diagram=',
'version=', 'help'])
except getopt.GetoptError, geo:
except getopt.GetoptError as geo:
sys.stderr.write("%s: %s\n" % (argv0, geo.msg))
sys.exit(1)

Expand Down Expand Up @@ -306,7 +306,7 @@ if __name__ == "__main__":
if len(line):
print(line)

except error.Error, e:
except error.Error as e:
sys.stderr.write("%s: %s\n" % (argv0, e.msg))
sys.exit(1)

Expand Down
4 changes: 2 additions & 2 deletions ovsdb/ovsdb-idlc.in
Expand Up @@ -1098,7 +1098,7 @@ if __name__ == "__main__":
['directory',
'help',
'version'])
except getopt.GetoptError, geo:
except getopt.GetoptError as geo:
sys.stderr.write("%s: %s\n" % (argv0, geo.msg))
sys.exit(1)

Expand Down Expand Up @@ -1136,7 +1136,7 @@ if __name__ == "__main__":
sys.exit(1)

func(*args[1:])
except ovs.db.error.Error, e:
except ovs.db.error.Error as e:
sys.stderr.write("%s: %s\n" % (argv0, e))
sys.exit(1)

Expand Down

0 comments on commit 52e4a47

Please sign in to comment.