First attempt at python2.4 compatibility