From 3b95df3cb712610d67df5e87a6e1d286aabc2365 Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Tue, 5 May 2020 20:22:20 -0400 Subject: Allow analysis completion callbacks without parameters --- python/binaryview.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'python/binaryview.py') diff --git a/python/binaryview.py b/python/binaryview.py index 42a09a91..016a6234 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -25,6 +25,7 @@ import ctypes import abc import numbers import json +import inspect from collections import OrderedDict @@ -217,7 +218,11 @@ class AnalysisCompletionEvent(object): if id(self) in _pending_analysis_completion_events: del _pending_analysis_completion_events[id(self)] try: - self.callback(self) + callback_sig = inspect.signature(self.callback) + if len(callback_sig.parameters): + self.callback(self) + else: + self.callback() except: log.log_error(traceback.format_exc()) -- cgit v1.3.1