Skip to content

Commit b4161dc

Browse files
committed
Fix tests again
1 parent 1d64e2b commit b4161dc

2 files changed

Lines changed: 20 additions & 7 deletions

File tree

stdlib/@tests/test_cases/check_tkinter.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,12 @@
22

33
import sys
44
import tkinter
5-
import traceback
65
import types
76
from typing import Optional, Tuple
87
from typing_extensions import assert_type
98

109

11-
def custom_handler(exc: type[BaseException], val: BaseException, tb: types.TracebackType | None) -> None:
12-
print("oh no")
13-
14-
1510
root = tkinter.Tk()
16-
root.report_callback_exception = traceback.print_exception # type: ignore[method-assign]
17-
root.report_callback_exception = custom_handler # type: ignore[method-assign]
1811
root.report_callback_exception(TypeError, TypeError("no"), None)
1912

2013

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# mypy: disable-error-code="method-assign"
2+
from __future__ import annotations
3+
4+
import tkinter
5+
import traceback
6+
import types
7+
8+
9+
def custom_handler(exc: type[BaseException], val: BaseException, tb: types.TracebackType | None) -> None:
10+
print("oh no")
11+
12+
13+
def custom_wrong_handler(exc: BaseException, val: BaseException, tb: types.TracebackType | None) -> None:
14+
print("oh no")
15+
16+
17+
root = tkinter.Tk()
18+
root.report_callback_exception = traceback.print_exception
19+
root.report_callback_exception = custom_handler
20+
root.report_callback_exception = custom_wrong_handler # type: ignore

0 commit comments

Comments
 (0)