make script python 3 compatible