[PATCH 6.2 133/141] scripts: handle BrokenPipeError for python scripts