Commit 6a278c27 authored by Ralf Schmitt's avatar Ralf Schmitt

make sure link receiver is callable

raise TypeError it it's not. the functionality to 'link to a greenlet'
has already been removed. make sure we fail early instead of the error
possibly going unnoticed when one passes a greenlet or anything not
callable.
parent 6fa96796
......@@ -19,6 +19,8 @@ class SpawnedLink(object):
__slots__ = ['callback']
def __init__(self, callback):
if not six.callable(callback):
raise TypeError("SpawnedLink argument '%s' object is not callable" % callback.__class__.__name__)
self.callback = callback
def __call__(self, source):
......
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