Python3 compatibility

This work was performed by Tejashri Kandolkar and Sandeep Shelke.