python: Fix print function compatibility.
[cascardo/ovs.git] / utilities / ovs-pcap.in
index ed35fc5..ae30047 100755 (executable)
@@ -14,6 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from __future__ import print_function
+
 import binascii
 import getopt
 import struct
@@ -57,7 +59,7 @@ argv0 = sys.argv[0]
 
 
 def usage():
-    print """\
+    print("""\
 %(argv0)s: print pcap file packet data as hex
 usage: %(argv0)s FILE
 where FILE is a PCAP file.
@@ -65,7 +67,7 @@ where FILE is a PCAP file.
 The following options are also available:
   -h, --help                  display this help message
   -V, --version               display version information\
-""" % {'argv0': argv0}
+""" % {'argv0': argv0})
     sys.exit(0)
 
 if __name__ == "__main__":
@@ -81,7 +83,7 @@ if __name__ == "__main__":
             if key in ['-h', '--help']:
                 usage()
             elif key in ['-V', '--version']:
-                print "ovs-pcap (Open vSwitch) @VERSION@"
+                print("ovs-pcap (Open vSwitch) @VERSION@")
             else:
                 sys.exit(0)
 
@@ -96,7 +98,7 @@ if __name__ == "__main__":
             if packet is None:
                 break
 
-            print binascii.hexlify(packet)
+            print(binascii.hexlify(packet))
 
     except PcapException as e:
         sys.stderr.write("%s: %s\n" % (argv0, e))