From 5c5c6770ea3cb704297602a3c0aaf0887a8f6917 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 9 Sep 2013 16:49:16 -0400 Subject: [PATCH] Have callback recognize any callable Previously, callback had to be a function. This misses a lot of things, notably instance methods. Change to recognize any callable. Change-Id: I9d2a00fe53f7e8039f0badeb4af0fdd3c6339b89 --- pyghmi/ipmi/console.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyghmi/ipmi/console.py b/pyghmi/ipmi/console.py index 5b005f10..167147ae 100644 --- a/pyghmi/ipmi/console.py +++ b/pyghmi/ipmi/console.py @@ -19,7 +19,6 @@ import fcntl import os import struct -import types from pyghmi.ipmi.private import constants from pyghmi.ipmi.private import session @@ -50,7 +49,7 @@ class Console(object): elif type(iohandler) == file: # one full duplex file handle self.console_out = iohandler self.console_in = iohandler - elif isinstance(iohandler, types.FunctionType): + elif hasattr(iohandler, '__call__'): self.console_out = None self.console_in = None self.out_handler = iohandler