Skip to content

Commit

Permalink
Run python scripts in unbuffered mode
Browse files Browse the repository at this point in the history
  • Loading branch information
robbplo committed Jan 10, 2022
1 parent 7b5d869 commit e6134f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Tasks/Python/RunScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public function run()
$path = $this->repository()->dir()->getPath($this->primaryFile);

chdir($this->repository()->dir()->getPath());
passthru("python $path"); // @todo does not work with pythons `input` function

// -u is to prevent input calls from buffering until after the script is executed
passthru("python -u $path");
}

public function message(): string
Expand Down

0 comments on commit e6134f7

Please sign in to comment.