summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_genericalias.py
diff options
context:
space:
mode:
authorYoda <64033043+yowoda@users.noreply.github.com>2024-09-01 11:47:07 (GMT)
committerGitHub <noreply@github.com>2024-09-01 11:47:07 (GMT)
commit42a818912bdb367c4ec2b7d58c18db35f55ebe3b (patch)
tree31e2f30b84347d5aeedcc4d06552b51fa4f8d140 /Lib/test/test_genericalias.py
parent64af2b29d2fcc4c4a305f970b6e81e7e79643b33 (diff)
downloadcpython-42a818912bdb367c4ec2b7d58c18db35f55ebe3b.zip
cpython-42a818912bdb367c4ec2b7d58c18db35f55ebe3b.tar.gz
cpython-42a818912bdb367c4ec2b7d58c18db35f55ebe3b.tar.bz2
gh-123341: Support `tkinter.Event` type subcript (#123353)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Diffstat (limited to 'Lib/test/test_genericalias.py')
-rw-r--r--Lib/test/test_genericalias.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py
index 04122fb..12564b4 100644
--- a/Lib/test/test_genericalias.py
+++ b/Lib/test/test_genericalias.py
@@ -57,6 +57,10 @@ from queue import Queue, SimpleQueue
from weakref import WeakSet, ReferenceType, ref
import typing
from typing import Unpack
+try:
+ from tkinter import Event
+except ImportError:
+ Event = None
from typing import TypeVar
T = TypeVar('T')
@@ -139,6 +143,8 @@ class BaseTest(unittest.TestCase):
if ValueProxy is not None:
generic_types.extend((ValueProxy, DictProxy, ListProxy, ApplyResult,
MPSimpleQueue, MPQueue, MPJoinableQueue))
+ if Event is not None:
+ generic_types.append(Event)
def test_subscriptable(self):
for t in self.generic_types: