Hi,
I noticed this check when specifying the callback function of an event subscription :
|
if type(callback) is not type(lambda x: x): |
In both python 2 and 3, type(lambda x: x) is <type 'function'> but in python2, a class or instance method is <type 'instancemethod'> and in python3 an instance method is <class 'method'>.
I think using the builtin callable() function would be more appropriate and would allow the use of an instance method as a callback. This modification solved the issue for me.
if not callable(callback):
Hi,
I noticed this check when specifying the callback function of an event subscription :
winevt/winevt/EventLog/Subscribe.py
Line 155 in 0c6ecc4
In both python 2 and 3,
type(lambda x: x)is<type 'function'>but in python2, a class or instance method is<type 'instancemethod'>and in python3 an instance method is<class 'method'>.I think using the builtin
callable()function would be more appropriate and would allow the use of an instance method as a callback. This modification solved the issue for me.