First but not optimized version of AstFormatDict
This commit is contained in:
@@ -92,6 +92,9 @@ class PythonEvaluator(OneReturnValueEvaluator):
|
||||
|
||||
debugger = context.get_debugger(PythonEvaluator.NAME, "eval")
|
||||
debugger.debug_entering(node=node)
|
||||
exception_debugger = context.get_debugger("Exceptions", PythonEvaluator.NAME + ".eval")
|
||||
get_trace_back = context.debug_enabled or exception_debugger.is_enabled()
|
||||
|
||||
context.log(f"Evaluating python node {node}.", self.name)
|
||||
|
||||
# If we evaluate a Concept metadata which is NOT the body ex (pre, post, where...)
|
||||
@@ -136,9 +139,12 @@ class PythonEvaluator(OneReturnValueEvaluator):
|
||||
except Exception as ex:
|
||||
if concepts_entries is None:
|
||||
concepts_entries = self.get_concepts_entries_from_globals(my_globals)
|
||||
errors.append(PythonEvalError(ex,
|
||||
traceback.format_exc() if context.debug_enabled else None,
|
||||
self.get_concepts_values_from_globals(globals_, concepts_entries)))
|
||||
eval_error = PythonEvalError(ex,
|
||||
traceback.format_exc() if get_trace_back else None,
|
||||
self.get_concepts_values_from_globals(globals_, concepts_entries))
|
||||
errors.append(eval_error)
|
||||
exception_debugger.debug_var("exception", eval_error.error, is_error=True)
|
||||
exception_debugger.debug_var("trace", eval_error.traceback, is_error=True)
|
||||
|
||||
if evaluated == NotInit:
|
||||
if len(errors) == 1:
|
||||
|
||||
Reference in New Issue
Block a user