Skip to content

Commit 98d3000

Browse files
committed
Remove PrintWarningsType
1 parent 800d080 commit 98d3000

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Lib/test/libregrtest/single.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import time
88
import traceback
99
import unittest
10-
from typing import Protocol, cast
10+
from typing import cast
1111

1212
from test import support
1313
from test.support import TestStats
@@ -189,11 +189,6 @@ def _runtest_env_changed_exc(result: TestResult, runtests: RunTests,
189189
result.state = State.PASSED
190190

191191

192-
class PrintWarningsType(Protocol):
193-
orig_stderr: io.TextIOWrapper
194-
def __call__(self, msg: str) -> None: ...
195-
196-
197192
def _runtest(result: TestResult, runtests: RunTests) -> None:
198193
# Capture stdout and stderr, set faulthandler timeout,
199194
# and create JUnit XML report.
@@ -216,7 +211,7 @@ def _runtest(result: TestResult, runtests: RunTests) -> None:
216211
stream = io.StringIO()
217212
orig_stdout = sys.stdout
218213
orig_stderr = sys.stderr
219-
print_warning = cast(PrintWarningsType, support.print_warning)
214+
print_warning = support.print_warning
220215
orig_print_warnings_stderr = print_warning.orig_stderr
221216

222217
output = None

0 commit comments

Comments
 (0)