Skip to content

Commit

Permalink
fix: Fix redirection of STDOUT
Browse files Browse the repository at this point in the history
  • Loading branch information
radimkarnis authored and peterdragun committed Jul 16, 2024
1 parent 6c2efdd commit e819927
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion esptool/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e819927

Please sign in to comment.