Modify to support Python 3.0

Update the code to change issue found by running 2to3 utility.