Hacked around to get Python 3 support.