BIND 10 master, updated. 3b408810eb76ca8e360da549b0e271d15d02b0ce [master] Fix callable() check in unit test

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Nov 29 17:14:33 UTC 2012


The branch, master has been updated
       via  3b408810eb76ca8e360da549b0e271d15d02b0ce (commit)
      from  d8748ae0321eca340142c98f708cdccc2d62bda7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3b408810eb76ca8e360da549b0e271d15d02b0ce
Author: Jelte Jansen <jelte at isc.org>
Date:   Thu Nov 29 18:13:22 2012 +0100

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

-----------------------------------------------------------------------

Summary of changes:
 src/bin/msgq/tests/msgq_test.py |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-----------------------------------------------------------------------
diff --git a/src/bin/msgq/tests/msgq_test.py b/src/bin/msgq/tests/msgq_test.py
index 4ed0441..4060190 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



More information about the bind10-changes mailing list