Skip to content
Snippets Groups Projects
Commit 12ea5da5 authored by Antoine Lambert's avatar Antoine Lambert
Browse files

output: Prevent BrokenPipeError with ndjson output

Ensure to flush stdout for ndjson output to avoid BrokenPipeError.

Fixes #4599.
parent 9a02abd4
No related branches found
No related tags found
No related merge requests found
......@@ -155,4 +155,4 @@ class Output:
print(json.dumps(self.data_as_json(), indent=4, sort_keys=True))
def print_ndjson(self):
print(ndjson.dumps({k: v} for k, v in self.data_as_json().items()))
print(ndjson.dumps({k: v} for k, v in self.data_as_json().items()), flush=True)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment