From: Jelte Jansen Date: Thu, 29 Nov 2012 17:13:22 +0000 (+0100) Subject: [master] Fix callable() check in unit test X-Git-Tag: bind10-1.0.0-beta-release~46^2~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b408810eb76ca8e360da549b0e271d15d02b0ce;p=thirdparty%2Fkea.git [master] Fix callable() check in unit test callable() has been removed in Python 3, but was reintroduced in Python 3.2. This fix (check for isinstance(obj, collections.Callable) should make the test work with 3.1 and older versions of 3. (acked on jabber) --- diff --git a/src/bin/msgq/tests/msgq_test.py b/src/bin/msgq/tests/msgq_test.py index 4ed0441933..4060190913 100644 --- a/src/bin/msgq/tests/msgq_test.py +++ b/src/bin/msgq/tests/msgq_test.py @@ -9,6 +9,7 @@ import time import errno import threading import isc.cc +import collections # # Currently only the subscription part and some sending is implemented... @@ -153,7 +154,7 @@ class BadSocket: # (except explicitely overridden ones) def __getattr__(self, name, *args): attr = getattr(self.socket, name) - if callable(attr): + if isinstance(attr, collections.Callable): def callable_attr(*args): return attr.__call__(*args) return callable_attr