Adapt crypt.crypt to python2 usage