From 3e993156f27b6d48b5770b0e99f9519427224c95 Mon Sep 17 00:00:00 2001 From: valeros Date: Mon, 8 Mar 2021 12:16:53 +0200 Subject: [PATCH] Suppress printing unnecessary info in silent mode // Resolve #3837 --- HISTORY.rst | 1 + platformio/platform/_run.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 7bac9c82..e9696882 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -13,6 +13,7 @@ PlatformIO Core 5 * Fixed a "The command line is too long" issue with a linking process on Windows (`issue #3827 `_) * Fixed an issue with `device monitor `__ when the "send_on_enter" filter didn't send EOL chars (`issue #3787 `_) +* Fixed an issue with silent mode when unwanted data is printed to stdout (`issue #3837 `_) 5.1.0 (2021-01-28) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/platform/_run.py b/platformio/platform/_run.py index 457983c4..cb5ec995 100644 --- a/platformio/platform/_run.py +++ b/platformio/platform/_run.py @@ -134,7 +134,9 @@ class PlatformRunMixin(object): args, stdout=proc.BuildAsyncPipe( line_callback=self._on_stdout_line, - data_callback=lambda data: _write_and_flush(sys.stdout, data), + data_callback=lambda data: None + if self.silent + else _write_and_flush(sys.stdout, data), ), stderr=proc.BuildAsyncPipe( line_callback=self._on_stderr_line,