From dbdf9b018a9effe0df4960f55d6a6af8de644ba6 Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Tue, 19 Dec 2023 12:10:39 -0600 Subject: [PATCH] Obtain sos_targets etc when some symbols are unavailable #1527 --- src/sos/eval.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sos/eval.py b/src/sos/eval.py index 152036b01..ec3c96c17 100644 --- a/src/sos/eval.py +++ b/src/sos/eval.py @@ -298,6 +298,9 @@ def SoS_exec(script: str, if _dict is None: _dict = env.sos_dict.dict() + if not 'sos_tagets' in _dict: + exec('from sos.runtime import *', _dict) + if not return_result: if env.verbosity == 0: with contextlib.redirect_stdout(None): @@ -505,4 +508,4 @@ def analyze_global_statements(global_stmt): f"Variable {key} cannot be defined in global section because it cannot be pickled to workers." ) from e return global_def, global_vars - \ No newline at end of file +