Skip to content

Commit

Permalink
Merge pull request #40 from Insoleet/gh34
Browse files Browse the repository at this point in the history
Fix issue #34
  • Loading branch information
harvimt committed Aug 20, 2015
2 parents 3e241f4 + 9df63b0 commit ff9c371
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions quamash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,14 @@ def call_later(self, delay, callback, *args):

def _add_callback(self, handle, delay=0):
def upon_timeout():
nonlocal timer
nonlocal handle
assert timer in self.__timers, 'Timer {} not among {}'.format(timer, self.__timers)
self.__timers.remove(timer)
timer = None
self._logger.debug('Callback timer fired, calling {}'.format(handle))
handle._run()
handle = None

self._logger.debug('Adding callback {} with delay {}'.format(handle, delay))
timer = QtCore.QTimer(self.__app)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_qeventloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ def fut_cb(fut):


@pytest.mark.parametrize('use_quamash',
[pytest.mark.xfail(True, reason="bug34"), False]
[True, False]
)
def test_exception_handler(use_quamash, loop):
handler_called = False
Expand Down

0 comments on commit ff9c371

Please sign in to comment.