winevt
winevt copied to clipboard
Event subscription callback on instance method
Hi,
I noticed this check when specifying the callback function of an event subscription : https://github.com/bannsec/winevt/blob/0c6ecc430e4cb95f36ae99957593f9c6783bbd46/winevt/EventLog/Subscribe.py#L155
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):
Good call, thanks! Will push update soon.