Skip to content

Commit 459232d

Browse files
committed
Fix formatting errors and make it pass CI tests
1 parent 2e945fe commit 459232d

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

Lib/test/test_pyrepl/test_windows_console.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import subprocess
99
from tempfile import TemporaryDirectory
1010
import os
11-
import time
1211
import itertools
1312
from functools import partial
1413
from test.support import force_not_colorized_test_class
@@ -585,10 +584,8 @@ class WindowsCommandLineTests(unittest.TestCase):
585584
def test_for_crash_traceback_with_redirected_stdout(self):
586585
"""python.bat -i -c "print('hlwd')" > file.txt"""
587586
script_command = "print('script has run')"
588-
589587
with TemporaryDirectory() as tmp_dir:
590588
stdout_path = os.path.join(tmp_dir, "WinCMDLineTests.txt")
591-
592589
with open(stdout_path, "w") as stdout_file, \
593590
subprocess.Popen(
594591
[sys.executable, '-i', '-c', script_command],
@@ -597,23 +594,16 @@ def test_for_crash_traceback_with_redirected_stdout(self):
597594
stderr=subprocess.PIPE,
598595
text=True, errors='replace'
599596
) as process:
600-
601597
stderr_output = ""
602-
603598
try:
604599
process.wait(timeout=3)
605-
self.fail(
606-
"Process exited unexpectedly within the timeout."
607-
)
608600
except subprocess.TimeoutExpired:
609601
process.kill()
610602
_, stderr_output = process.communicate()
611-
612603
has_crash_traceback = (
613604
"OSError" in stderr_output and
614605
len(stderr_output) > 1200
615606
)
616-
617607
if has_crash_traceback:
618608
self.fail("Detected endless OSError traceback."
619609
f"\n--- stderr ---\n{stderr_output[:1200]}")

0 commit comments

Comments
 (0)