Skip to content

Commit 4561ddf

Browse files
newberynedbat
authored andcommitted
python 3.7 compat version of detecting console tty
1 parent da5756d commit 4561ddf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

coverage/html.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def index_file(self, first_html: str, final_html: str) -> None:
495495
index_file = os.path.join(self.directory, "index.html")
496496
write_html(index_file, html)
497497

498-
if os.isatty(sys.stdout.fileno()):
498+
if sys.stdout.isatty():
499499
file_path = f"file://{os.path.abspath(index_file)}"
500500
print_path = f"\033]8;;{file_path}\a{index_file}\033]8;;\a"
501501
else:

coverage/report.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def render_report(
5959
try:
6060
ret = reporter.report(morfs, outfile=outfile)
6161
if file_to_close is not None:
62-
if os.isatty(sys.stdout.fileno()):
62+
if sys.stdout.isatty():
6363
file_path = f"file://{os.path.abspath(output_path)}"
6464
print_path = f"\033]8;;{file_path}\a{output_path}\033]8;;\a"
6565
else:

0 commit comments

Comments
 (0)