Skip to content

Commit

Permalink
Fix interactive parameter evaluation for sandbox tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
riga committed Nov 7, 2023
1 parent f577b75 commit a9dc218
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions law/task/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,18 @@ def __call__(cls, *args, **kwargs):
for param in inst.interactive_params:
value = getattr(inst, param)
if value:
# reset the interactive parameter
setattr(inst, param, ())

# at this point, inst must be the root task so set the global value
root_task(inst)

skip_abort = False
try:
logger.debug("evaluating interactive parameter '{}' with value {}".format(
param, value))
skip_abort = getattr(inst, "_" + param)(value)

# reset the interactive parameter
setattr(inst, param, ())
skip_abort = getattr(inst, "_" + param)(value)

except KeyboardInterrupt:
print("\naborted")
Expand Down

0 comments on commit a9dc218

Please sign in to comment.