diff --git a/ufo/automator/ui_control/controller.py b/ufo/automator/ui_control/controller.py index 24ba147d..4568c511 100644 --- a/ufo/automator/ui_control/controller.py +++ b/ufo/automator/ui_control/controller.py @@ -365,7 +365,16 @@ def wait_enabled(self, timeout: int = 10, retry_interval: int = 0.5) -> None: :param timeout: The timeout to wait. :param retry_interval: The retry interval to wait. """ - while not self.control.is_enabled(): + while True: + try: + if self.control.is_enabled(): + break + except Exception as e: + logger.warning( + f"Exception while checking if control is enabled, " + f"assuming it is ready: {e}" + ) + break time.sleep(retry_interval) timeout -= retry_interval if timeout <= 0: