def _make_signal_handler(self, target):
""" Make the signal handler for a specified target object.
:param target: A specification of the target for the
handler; see below.
:return: The value for use by `signal.signal()`.
If `target` is ``None``, return ``signal.SIG_IGN``. If `target`
is a text string, return the attribute of this instance named
by that string. Otherwise, return `target` itself.
"""
if target is None:
result = signal.SIG_IGN
elif isinstance(target, unicode):
name = target
result = getattr(self, name)
else:
result = target
return result
评论列表
文章目录