2
0
mirror of https://opendev.org/x/pyghmi synced 2026-05-14 02:14:21 +00:00

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
This commit is contained in:
Jarrod Johnson
2013-09-09 16:49:16 -04:00
parent ef22636766
commit 5c5c6770ea
+1 -2
View File
@@ -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