Fix python3 except clause error.