This is an excellent idea, @davehunt. Unfortunately it doesn't seem to work. It seems that `or` is not short-circuited inside a `lambda`, so both expressions are evaluated. In the case where `window_handles` does become 1, because the Persona window is closed, the second statement being executed seems to result in an infinite wait (which in itself seems pretty strange). Can you think of any other ways to avoid the `sleep()`?