[python] How to exit an if clause