correctly support python2.4