Fix ts for python