compatible with python2.6