[Pkg-bitcoin-commits] [python-quamash] 240/269: Fix issue #34

Jonas Smedegaard dr at jones.dk
Fri Nov 24 11:26:37 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository python-quamash.

commit 0c2f41e9a5bb5358ed34fe5fd595e733a299b22e
Author: Inso <insomniak.fr at gmail.com>
Date:   Thu Aug 20 16:55:10 2015 +0200

    Fix issue #34
---
 quamash/__init__.py      | 4 ++++
 tests/test_qeventloop.py | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/quamash/__init__.py b/quamash/__init__.py
index 5a357cf..cfd2ea2 100644
--- a/quamash/__init__.py
+++ b/quamash/__init__.py
@@ -347,10 +347,14 @@ class QEventLoop(_baseclass):
 
 	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)
diff --git a/tests/test_qeventloop.py b/tests/test_qeventloop.py
index 7fadb24..6e13a55 100644
--- a/tests/test_qeventloop.py
+++ b/tests/test_qeventloop.py
@@ -691,7 +691,7 @@ def test_scheduling(loop, sock_pair):
 
 
 @pytest.mark.parametrize('use_quamash',
-	[pytest.mark.xfail(True, reason="bug34"), False]
+	[True, False]
 )
 def test_exception_handler(use_quamash, loop):
 	handler_called = False
@@ -716,6 +716,7 @@ def test_exception_handler(use_quamash, loop):
 	asyncio.async(future_except())
 	loop.run_forever()
 
+
 	assert coro_run
 	assert handler_called
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bitcoin/python-quamash.git



More information about the Pkg-bitcoin-commits mailing list