Python End Program On Error Mathcad