fix py2.6 and py3.2