Skip to content

Commit 10134cd

Browse files
committed
Set default Python version to 'python3' in ProactiveTask and update subprocess call accordingly
1 parent d0f3900 commit 10134cd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

proactive/model/ProactiveTask.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def __init__(self, script_language=None, task_name=''):
4646
self.flow_block = None
4747
self.precious_result = False
4848
self.task_error_policy = 'continueJobExecution' # Default behavior
49+
self.default_python = 'python3'
4950

5051
def __str__(self):
5152
return self.getTaskName()
@@ -462,7 +463,7 @@ def setTaskExecutionFromFile(self, task_file, parameters=[], displayTaskResultOn
462463
task_implementation += "\n"
463464
task_implementation += "print('Running " + task_file + " with " + params_string + " as parameters...')"
464465
task_implementation += "\n"
465-
task_implementation += "result = subprocess.check_output('python " + task_file + " " + params_string + "', shell=True).strip()"
466+
task_implementation += "result = subprocess.check_output('" + self.default_python + " " + task_file + " " + params_string + "', shell=True).strip()"
466467
task_implementation += "\n"
467468
if displayTaskResultOnScheduler:
468469
task_implementation += "print('-' * 10)"

0 commit comments

Comments
 (0)