system-traffic: Fix typo in IPv6 tests.
[cascardo/ovs.git] / tests / test-json.py
index 0ec1cfc..16b3fae 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2010 Nicira Networks.
+# Copyright (c) 2009, 2010 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from __future__ import print_function
+
 import codecs
 import getopt
 import sys
 
 import ovs.json
+import six
 
 
 def print_json(json):
-    if type(json) in [str, unicode]:
-        print "error: %s" % json
+    if isinstance(json, six.string_types):
+        print("error: %s" % json)
         return False
     else:
         ovs.json.to_stream(json, sys.stdout)
@@ -61,7 +64,7 @@ def main(argv):
 
     try:
         options, args = getopt.gnu_getopt(argv[1:], '', ['multiple'])
-    except getopt.GetoptError, geo:
+    except getopt.GetoptError as geo:
         sys.stderr.write("%s: %s\n" % (argv0, geo.msg))
         sys.exit(1)