Applied fix mentioned in #133 by SoftwareMaven for Python 3 compatibility

Full credit goes to SoftwareMaven for this fix; I'm just creating this PR to make it easier to merge.