diff options
| author | Josh Ferrell <josh@vector35.com> | 2020-05-05 20:22:20 -0400 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2020-05-05 20:22:20 -0400 |
| commit | 3b95df3cb712610d67df5e87a6e1d286aabc2365 (patch) | |
| tree | 452383ab8cb2998a859297a90fe2052366c3a181 /python | |
| parent | 38040844e78916e5ec2a861c0ba5794d99ac2d0e (diff) | |
Allow analysis completion callbacks without parameters
Diffstat (limited to 'python')
| -rw-r--r-- | python/binaryview.py | 7 |
1 files changed, 6 insertions, 1 deletions
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()) |
