Skip to content

Commit 2fc53d3

Browse files
committed
Do not depend on test.support
1 parent ae6f37a commit 2fc53d3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/test_typing_extensions.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8844,9 +8844,12 @@ def test_name_lookup_without_eval(self):
88448844
self.assertIs(evaluate_forward_ref(typing.ForwardRef("int"), globals={"int": str}), str)
88458845
import builtins
88468846

8847-
from test import support
8848-
with support.swap_attr(builtins, "int", dict):
8847+
real_int = builtins.int
8848+
try:
8849+
builtins.int = dict
88498850
self.assertIs(evaluate_forward_ref(typing.ForwardRef("int")), dict)
8851+
finally:
8852+
builtins.int = real_int
88508853

88518854
def test_nested_strings(self):
88528855
# This variable must have a different name TypeVar

0 commit comments

Comments
 (0)