Commit 3b408810 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[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)
parent d8748ae0
......@@ -9,6 +9,7 @@ import time
import errno
import threading
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment