Changes to make code both python2.7 and python3 compatible
Merge pull request #1 from hunse/2to3

Changes to make code both python2.7 and python3 compatible