fix for py27 and hopefully py32