python2.5 and python3 workarounds