From 2090086012923751002522947224572306950039 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Fri, 3 Feb 2023 15:54:41 -0500 Subject: Fix ScriptingProviders.update_locals raising causing console entry to fail Re: #3596 --- python/scriptingprovider.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'python/scriptingprovider.py') diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py index cbd5df93..62462bdf 100644 --- a/python/scriptingprovider.py +++ b/python/scriptingprovider.py @@ -746,7 +746,10 @@ from binaryninja import * PythonScriptingInstance._interpreter.value = self try: - self.update_locals() + try: + self.update_locals() + except: + traceback.print_exc() if isinstance(_code, (lambda: 0).__code__.__class__): self.interpreter.runcode(_code) @@ -1152,7 +1155,10 @@ from binaryninja import * # to avoid updating the local variables every time. So the compromise is to only do an explicit update when the # view is None. if view is None: - self.interpreter.update_locals() + try: + self.interpreter.update_locals() + except: + traceback.print_exc() @abc.abstractmethod def perform_set_current_function(self, func): @@ -1173,7 +1179,10 @@ from binaryninja import * @abc.abstractmethod def perform_complete_input(self, text, state): - self.interpreter.update_locals() + try: + self.interpreter.update_locals() + except: + traceback.print_exc() result = self.interpreter.completer.complete(text, state) if result is None: return "" -- cgit v1.3.1