Skip to content

Commit

Permalink
Obtain sos_targets etc when some symbols are unavailable #1527
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo Peng committed Dec 19, 2023
1 parent b48a656 commit dbdf9b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sos/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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


0 comments on commit dbdf9b0

Please sign in to comment.