make c extension complatible with python2