This makes the code compatible with both python 2 and 3. Change-Id: Ic1c5c8d4a85db138a8402ea4b3208828fc118a40