We recently fixed this for TypeScript, Python should do the same. Otherwise a `patched` statement in a `wait_condition` function might generate commands when it shouldn't.