fix tab-space mixup and take steps toward Python3