lib/tdb: convert print func to be py2/py3 compatible
authorNoel Power <noel.power@suse.com>
Fri, 9 Mar 2018 14:07:31 +0000 (14:07 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 23 Mar 2018 06:28:24 +0000 (07:28 +0100)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
lib/tdb/python/tdbdump.py

index 01859eb..a16d26e 100644 (file)
@@ -1,12 +1,13 @@
 #!/usr/bin/env python
 # Trivial reimplementation of tdbdump in Python
 
+from __future__ import print_function
 import tdb, sys
 
 if len(sys.argv) < 2:
-    print "Usage: tdbdump.py <tdb-file>"
+    print("Usage: tdbdump.py <tdb-file>")
     sys.exit(1)
 
 db = tdb.Tdb(sys.argv[1])
 for (k, v) in db.iteritems():
-    print "{\nkey(%d) = %r\ndata(%d) = %r\n}" % (len(k), k, len(v), v)
+    print("{\nkey(%d) = %r\ndata(%d) = %r\n}" % (len(k), k, len(v), v))