[Pkg-bitcoin-commits] [python-quamash] 139/269: Ignore futures that are already done

Jonas Smedegaard dr at jones.dk
Fri Nov 24 11:26:24 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 b621c5352158ba50d2e9ac445172dde669417238
Author: Arve Knudsen <arve.knudsen at gmail.com>
Date:   Wed Nov 26 13:39:07 2014 +0100

    Ignore futures that are already done
---
 quamash/_windows.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/quamash/_windows.py b/quamash/_windows.py
index 9720eb8..e44040b 100644
--- a/quamash/_windows.py
+++ b/quamash/_windows.py
@@ -83,9 +83,9 @@ class _IocpProactor(windows_events.IocpProactor):
 			# self._logger.debug('Polling IOCP with timeout {} ms in thread {}...'.format(
 			# 	ms, threading.get_ident()))
 			status = _overlapped.GetQueuedCompletionStatus(self._iocp, ms)
-
 			if status is None:
 				break
+
 			err, transferred, key, address = status
 			try:
 				f, ov, obj, callback = self._cache.pop(address)
@@ -99,7 +99,8 @@ class _IocpProactor(windows_events.IocpProactor):
 
 			if obj in self._stopped_serving:
 				f.cancel()
-			elif not f.cancelled():
+			# Futures might already be resolved or cancelled
+			elif not f.done():
 				self.__events.append((f, callback, transferred, key, ov))
 
 			ms = 0

-- 
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