port to python2.6 and python2.7.  sad