bug fix for python 3

Have I mentioned how much I hate Python 3?