Skip to content

Commit

Permalink
fix: Fix redirection of STDOUT
Browse files Browse the repository at this point in the history
Closes #904
  • Loading branch information
radimkarnis committed Aug 8, 2023
1 parent 8273916 commit 9585c0e
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 9585c0e

Please sign in to comment.