Index: tools/checkers/clang.py
===================================================================
--- tools/checkers/clang.py	(revision 1dbe4654725ea80d44d0844ebe3093b1bbbcb4dd)
+++ tools/checkers/clang.py	(revision 814752508c9a361c0614c3827238008185400fb7)
@@ -114,5 +114,5 @@
 	for job in jobs:
 		if (not clang(rootdir, job)):
-			print
+			print()
 			print("Failed job: %s" % job)
 			return
Index: tools/checkers/stanse.py
===================================================================
--- tools/checkers/stanse.py	(revision 1dbe4654725ea80d44d0844ebe3093b1bbbcb4dd)
+++ tools/checkers/stanse.py	(revision 814752508c9a361c0614c3827238008185400fb7)
@@ -127,5 +127,5 @@
 	for job in jobs:
 		if (not stanse(rootdir, job)):
-			print
+			print()
 			print("Failed job: %s" % job)
 			return
Index: tools/checkers/vcc.py
===================================================================
--- tools/checkers/vcc.py	(revision 1dbe4654725ea80d44d0844ebe3093b1bbbcb4dd)
+++ tools/checkers/vcc.py	(revision 814752508c9a361c0614c3827238008185400fb7)
@@ -204,9 +204,9 @@
 	for job in jobs:
 		if (not vcc(vcc_path, rootdir, job)):
-			print
+			print()
 			print("Failed job: %s" % job)
 			return
 	
-	print
+	print()
 	print("All jobs passed")
 
Index: tools/filldir.py
===================================================================
--- tools/filldir.py	(revision 1dbe4654725ea80d44d0844ebe3093b1bbbcb4dd)
+++ tools/filldir.py	(revision 814752508c9a361c0614c3827238008185400fb7)
@@ -37,5 +37,5 @@
 
 if len(sys.argv) < 3:
-	print 'Usage: filldir <parent-dir> <count>'
+	print('Usage: filldir <parent-dir> <count>')
 	exit(2)
 
Index: tools/gentestfile.py
===================================================================
--- tools/gentestfile.py	(revision 1dbe4654725ea80d44d0844ebe3093b1bbbcb4dd)
+++ tools/gentestfile.py	(revision 814752508c9a361c0614c3827238008185400fb7)
@@ -36,8 +36,8 @@
 
 if len(sys.argv) < 2:
-	print "Usage: gentestfile.py <count of 64-bit numbers to output>"
+	print("Usage: gentestfile.py <count of 64-bit numbers to output>")
 	exit()
 
-m = long(sys.argv[1])
+m = int(sys.argv[1])
 i = 0
 pow_2_64 = 2 ** 64
Index: tools/mkfat.py
===================================================================
--- tools/mkfat.py	(revision 1dbe4654725ea80d44d0844ebe3093b1bbbcb4dd)
+++ tools/mkfat.py	(revision 814752508c9a361c0614c3827238008185400fb7)
@@ -247,5 +247,6 @@
 	return bs
 
-def create_lfn_entry((name, index)) :
+def create_lfn_entry(name_index) :
+	(name, index) = name_index
 	entry = xstruct.create(LFN_ENTRY)
 
@@ -293,5 +294,5 @@
 		return [dir_entry]
 
-	n = len(name) / 13 + 1
+	n = (int) (len(name) / 13 + 1)
 	names = [(name[i * 13: (i + 1) * 13 + 1], i + 1) for i in range(n)]
 
@@ -299,5 +300,5 @@
 	entries[0].pos |= 0x40
 
-	fname11 = dir_entry.name + dir_entry.ext
+	fname11 = str(dir_entry.name + dir_entry.ext)
 
 	csum = 0
Index: tools/mkuimage.py
===================================================================
--- tools/mkuimage.py	(revision 1dbe4654725ea80d44d0844ebe3093b1bbbcb4dd)
+++ tools/mkuimage.py	(revision 814752508c9a361c0614c3827238008185400fb7)
@@ -124,5 +124,5 @@
 	header.img_type = 2		# Kernel
 	header.compression = 0		# None
-	header.img_name = image_name
+	header.img_name = image_name.encode('ascii')
 
 	header_crc = calc_crc32(header.pack())
@@ -140,5 +140,5 @@
 	signed_crc = zlib.crc32(byteseq, 0)
 	if signed_crc < 0:
-		return (long(signed_crc) + (long(2) ** long(32))) # 2^32L
+		return signed_crc + (1 << 32)
 	else:
 		return signed_crc
@@ -148,8 +148,8 @@
 def print_syntax(cmd):
 	print("syntax: " + cmd + " [<options>] <raw_image> <uImage>")
-	print
+	print()
 	print("\traw_image\tInput image name (raw binary data)")
 	print("\tuImage\t\tOutput uImage name (U-Boot image)")
-	print
+	print()
 	print("options:")
 	print("\t-name <name>\tImage name (default: 'Noname')")
Index: tools/xstruct.py
===================================================================
--- tools/xstruct.py	(revision 1dbe4654725ea80d44d0844ebe3093b1bbbcb4dd)
+++ tools/xstruct.py	(revision 814752508c9a361c0614c3827238008185400fb7)
@@ -32,15 +32,18 @@
 
 import struct
+import sys
 import types
 
+integer_types = (int, long) if sys.version < '3' else (int,)
+
 ranges = {
-	'B': ((int, long), 0x00, 0xff),
-	'H': ((int, long), 0x0000, 0xffff),
-	'L': ((int, long), 0x00000000, 0xffffffff),
-	'Q': ((int, long), 0x0000000000000000, 0xffffffffffffffff),
-	'b': ((int, long), -0x80, 0x7f),
-	'h': ((int, long), -0x8000, 0x7fff),
-	'l': ((int, long), -0x80000000, 0x7fffffff) ,
-	'q': ((int, long), -0x8000000000000000, 0x7fffffffffffffff),
+	'B': (integer_types, 0x00, 0xff),
+	'H': (integer_types, 0x0000, 0xffff),
+	'L': (integer_types, 0x00000000, 0xffffffff),
+	'Q': (integer_types, 0x0000000000000000, 0xffffffffffffffff),
+	'b': (integer_types, -0x80, 0x7f),
+	'h': (integer_types, -0x8000, 0x7fff),
+	'l': (integer_types, -0x80000000, 0x7fffffff) ,
+	'q': (integer_types, -0x8000000000000000, 0x7fffffffffffffff),
 }
 
