python3 compatiblity for repair.py