Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions pyia/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
from event import Event
from utils import accessibleObjectFromEvent

RPC_S_CALLPENDING = -2147417835

class Registry(object):
def __init__(self):
self.clients = {}
Expand Down Expand Up @@ -87,8 +89,15 @@ def clearListeners(self):


def iter_loop(self, timeout=1):
PumpEvents(timeout)

try:
PumpEvents(timeout)
except OSError as e:
# Work around https://github.com/enthought/comtypes/issues/138.
# RPC_S_CALLPENDING just means the timeout expired, so we can
# ignore it.
if e.winerror != RPC_S_CALLPENDING:
raise

def start(self):
while True:
try:
Expand Down