From 64dc134d424420af9b14e09b3667c5c7fc0106b0 Mon Sep 17 00:00:00 2001 From: Leonard de Ruijter Date: Thu, 18 Jul 2019 10:58:00 +0200 Subject: [PATCH] Fix waiting for outlook/powerpoint window to exist for ever --- source/appModules/outlook.py | 5 ++++- source/appModules/powerpnt.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source/appModules/outlook.py b/source/appModules/outlook.py index 772ce3245c2..bf0253e1862 100644 --- a/source/appModules/outlook.py +++ b/source/appModules/outlook.py @@ -108,7 +108,10 @@ def _registerCOMWithFocusJuggle(self): self._hasTriedoutlookAppSwitch=True #Make sure NVDA detects and reports focus on the waiting dialog api.processPendingEvents() - comtypes.client.PumpEvents(1) + try: + comtypes.client.PumpEvents(1) + except WindowsError: + log.debugWarning("Error while pumping com events", exc_info=True) d.Destroy() gui.mainFrame.postPopup() diff --git a/source/appModules/powerpnt.py b/source/appModules/powerpnt.py index 84cf11fc14b..4b07db56683 100644 --- a/source/appModules/powerpnt.py +++ b/source/appModules/powerpnt.py @@ -1257,7 +1257,10 @@ def _registerCOMWithFocusJuggle(self): self.hasTriedPpAppSwitch=True #Make sure NVDA detects and reports focus on the waiting dialog api.processPendingEvents() - comtypes.client.PumpEvents(1) + try: + comtypes.client.PumpEvents(1) + except WindowsError: + log.debugWarning("Error while pumping com events", exc_info=True) d.Destroy() gui.mainFrame.postPopup()