[Pkg-bitcoin-commits] [python-quamash] 184/269: Remove warnings from {add, remove}_{reader, writer} on duplicate calls

Jonas Smedegaard dr at jones.dk
Fri Nov 24 11:26:30 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 4eef5c52260cfcf019d2e4ade57e82a83d138ad0
Author: Jonas Wielicki <j.wielicki at sotecware.net>
Date:   Fri Jan 9 21:17:17 2015 +0100

    Remove warnings from {add,remove}_{reader,writer} on duplicate calls
    
    According to [PEP 3156, Section "I/O Callbacks"][0], calling each of
    remove_reader/writer and add_reader/writer multiple times in sequence on
    the same fd without adding/removing a reader/writer inbetween is legal.
    Logging a warning is not neccessary.
    
       [0]: https://www.python.org/dev/peps/pep-3156/#i-o-callbacks
---
 quamash/__init__.py | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/quamash/__init__.py b/quamash/__init__.py
index 7941c16..418aced 100644
--- a/quamash/__init__.py
+++ b/quamash/__init__.py
@@ -368,9 +368,6 @@ class QEventLoop(_baseclass):
 			existing.setEnabled(False)
 			existing.activated.disconnect()
 			# will get overwritten by the assignment below anyways
-			self._logger.warning(
-				'There is already a reader attached for fd {}'.format(fd)
-			)
 
 		notifier = QtCore.QSocketNotifier(fd, QtCore.QSocketNotifier.Read)
 		notifier.setEnabled(True)
@@ -387,9 +384,6 @@ class QEventLoop(_baseclass):
 		try:
 			notifier = self._read_notifiers.pop(fd)
 		except KeyError:
-			self._logger.warning(
-				'Attempt to remove non-existent reader callback for file descriptor {}'.format(fd)
-			)
 			return False
 		else:
 			notifier.setEnabled(False)
@@ -406,9 +400,6 @@ class QEventLoop(_baseclass):
 			existing.setEnabled(False)
 			existing.activated.disconnect()
 			# will get overwritten by the assignment below anyways
-			self._logger.warning(
-				'There is already a writer attached for fd {}'.format(fd)
-			)
 
 		notifier = QtCore.QSocketNotifier(fd, QtCore.QSocketNotifier.Write)
 		notifier.setEnabled(True)
@@ -425,9 +416,6 @@ class QEventLoop(_baseclass):
 		try:
 			notifier = self._write_notifiers.pop(fd)
 		except KeyError:
-			self._logger.warning(
-				'Attempt to remove non-existent writer callback for file descriptor {}'.format(fd)
-			)
 			return False
 		else:
 			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