[Pkg-bitcoin-commits] [python-quamash] 132/269: Fix event loop closing

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 1fa3054bdfe5c17de6ac4a97c15863caa76e0809
Author: Arve Knudsen <arve.knudsen at gmail.com>
Date:   Sat Dec 6 19:11:52 2014 +0100

    Fix event loop closing
---
 quamash/__init__.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/quamash/__init__.py b/quamash/__init__.py
index 1b27654..9cfb845 100644
--- a/quamash/__init__.py
+++ b/quamash/__init__.py
@@ -282,16 +282,17 @@ class QEventLoop(_baseclass):
 
 	def close(self):
 		"""Close event loop."""
-		self.__timers = []
-		self.__app = None
+		self._logger.debug('Closing event loop...')
 		if self.__default_executor is not None:
 			self.__default_executor.shutdown()
 
+		super().close()
+
+		self.__timers = []
+		self.__app = None
 		self._read_notifiers = {}
 		self._write_notifiers = {}
 
-		super().close()
-
 	def call_later(self, delay, callback, *args):
 		"""Register callback to be invoked after a certain delay."""
 		if asyncio.iscoroutinefunction(callback):
@@ -341,6 +342,7 @@ class QEventLoop(_baseclass):
 
 	def remove_reader(self, fd):
 		"""Remove reader callback."""
+		self._logger.debug('Removing reader callback for file descriptor {}'.format(fd))
 		notifier = self._read_notifiers.pop(fd)
 		notifier.setEnabled(False)
 
@@ -354,6 +356,7 @@ class QEventLoop(_baseclass):
 
 	def remove_writer(self, fd):
 		"""Remove writer callback."""
+		self._logger.debug('Removing writer callback for file descriptor {}'.format(fd))
 		notifier = self._write_notifiers.pop(fd)
 		notifier.setEnabled(False)
 

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