python while except keyboardinterrupt