Skip to content

Commit ef53aca

Browse files
committed
fix: remove unnecessary std out handling
1 parent dea212d commit ef53aca

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

benchmark.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,11 @@ def parse_args() -> argparse.Namespace:
453453
args = parse_args()
454454

455455
file_handle = None
456-
old_stdout = sys.stdout
457456
try:
458457
if args.out is not None:
459458
args.out.parent.mkdir(parents=True, exist_ok=True)
460459
file_handle = args.out.open("w", encoding="utf-8")
461-
sys.stdout = Tee(old_stdout, file_handle) # type: ignore[assignment]
460+
sys.stdout = Tee(sys.stdout, file_handle) # type: ignore[assignment]
462461

463462
benchmark_seconds = tuple(args.runs)
464463
print(f"Start benchmarking: benchmark_seconds={benchmark_seconds}")
@@ -475,6 +474,5 @@ def parse_args() -> argparse.Namespace:
475474
print_runs_table_and_summary(results)
476475

477476
finally:
478-
sys.stdout = old_stdout
479477
if file_handle is not None:
480478
file_handle.close()

0 commit comments

Comments
 (0)