fix py2.5/2.6 compat