Python curls up in engine