From ac7a6f750e4fcdf3226e22f1d75894a35dd0a773 Mon Sep 17 00:00:00 2001 From: mahendar7 Date: Thu, 3 Oct 2019 13:35:49 +0530 Subject: [PATCH] print statements converted from python 2 to python 3 --- build/compiletest.py | 4 ++-- dev/bloomfiltertest.py | 21 +++++++++------------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/build/compiletest.py b/build/compiletest.py index fdbf7db1..3180c846 100755 --- a/build/compiletest.py +++ b/build/compiletest.py @@ -19,5 +19,5 @@ for filename in matches: if 'win' in sys.platform: ctypes.windll.user32.MessageBoxA(0, traceback.format_exc(), "Exception in " + filename, 1) else: - print "Exception in %s: %s" % (filename, traceback.format_exc()) - sys.exit(1) + print ("Exception in %s: %s" % (filename, traceback.format_exc())) + sys.exit(1) \ No newline at end of file diff --git a/dev/bloomfiltertest.py b/dev/bloomfiltertest.py index 8f7b5f69..23b2ff5d 100644 --- a/dev/bloomfiltertest.py +++ b/dev/bloomfiltertest.py @@ -52,15 +52,12 @@ for row in cur.fetchall(): # f.close() -print "Item count: %i" % (itemcount) -print "Raw length: %i" % (rawlen) -print "Bloom filter 1 length: %i, reduction to: %.2f%%" % \ - (bf1.bitarray.buffer_info()[1], - 100.0 * bf1.bitarray.buffer_info()[1] / rawlen) -print "Bloom filter 1 capacity: %i and error rate: %.3f%%" % (bf1.capacity, 100.0 * bf1.error_rate) -print "Bloom filter 1 took %.2fs" % (bf1time) -print "Bloom filter 2 length: %i, reduction to: %.3f%%" % \ - (bf2.num_bits / 8, - 100.0 * bf2.num_bits / 8 / rawlen) -print "Bloom filter 2 capacity: %i and error rate: %.3f%%" % (bf2.capacity, 100.0 * bf2.error_rate) -print "Bloom filter 2 took %.2fs" % (bf2time) +print("Item count: %i" % itemcount) +print("Raw length: %i" % rawlen) +print("Bloom filter 1 length: %i, reduction to: %.2f%%" % bf1.bitarray.buffer_info()[1], + 100.0 * bf1.bitarray.buffer_info()[1] / rawlen) +print("Bloom filter 1 capacity: %i and error rate: %.3f%%" % bf1.capacity, 100.0 * bf1.error_rate) +print("Bloom filter 1 took %.2fs" % bf1time) +print("Bloom filter 2 length: %i, reduction to: %.3f%%" % bf2.num_bits / 8, 100.0 * bf2.num_bits / 8 / rawlen) +print("Bloom filter 2 capacity: %i and error rate: %.3f%%" % bf2.capacity, 100.0 * bf2.error_rate) +print("Bloom filter 2 took %.2fs" % bf2time)