mirror of
https://github.com/espressif/esptool.git
synced 2025-10-16 23:06:31 +08:00
fix: Fix redirection of STDOUT
Closes https://github.com/espressif/esptool/issues/904
This commit is contained in:
@@ -68,7 +68,7 @@ def print_overwrite(message, last_line=False):
|
||||
If output is not a TTY (for example redirected a pipe),
|
||||
no overwriting happens and this function is the same as print().
|
||||
"""
|
||||
if sys.stdout.isatty():
|
||||
if hasattr(sys.stdout, "isatty") and sys.stdout.isatty():
|
||||
print("\r%s" % message, end="\n" if last_line else "")
|
||||
else:
|
||||
print(message)
|
||||
|
Reference in New Issue
Block a user