Skip to content

Commit

Permalink
python 3.7 compat version of detecting console tty
Browse files Browse the repository at this point in the history
  • Loading branch information
newbery authored and nedbat committed Apr 26, 2023
1 parent da5756d commit 4561ddf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion coverage/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def index_file(self, first_html: str, final_html: str) -> None:
index_file = os.path.join(self.directory, "index.html")
write_html(index_file, html)

if os.isatty(sys.stdout.fileno()):
if sys.stdout.isatty():
file_path = f"file://{os.path.abspath(index_file)}"
print_path = f"\033]8;;{file_path}\a{index_file}\033]8;;\a"
else:
Expand Down
2 changes: 1 addition & 1 deletion coverage/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def render_report(
try:
ret = reporter.report(morfs, outfile=outfile)
if file_to_close is not None:
if os.isatty(sys.stdout.fileno()):
if sys.stdout.isatty():
file_path = f"file://{os.path.abspath(output_path)}"
print_path = f"\033]8;;{file_path}\a{output_path}\033]8;;\a"
else:
Expand Down

0 comments on commit 4561ddf

Please sign in to comment.