File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change 8484# specific ones that aren't quite so general but fit into common
8585# specialized cases.
8686
87- import sys
87+ import types
8888from typing import Optional
8989from warnings import warn
9090
91- if sys .version_info [:3 ] >= (3 , 9 , 0 ):
92- from types import GenericAlias
93- else :
94- from typing import _GenericAlias as GenericAlias # type: ignore[name-defined]
95-
9691import pygame
9792from pygame .mask import from_surface
9893from pygame .rect import Rect
@@ -377,7 +372,7 @@ class AbstractGroup:
377372 """
378373
379374 def __class_getitem__ (cls , generic ):
380- return GenericAlias (cls , generic )
375+ return types . GenericAlias (cls , generic )
381376
382377 # protected identifier value to identify sprite groups, and avoid infinite recursion
383378 _spritegroup = True
Original file line number Diff line number Diff line change 11#################################### IMPORTS ###################################
22
3- import sys
3+ import types
44import typing
55import unittest
66
7- if sys .version_info [:3 ] >= (3 , 9 , 0 ):
8- from types import GenericAlias
9- else :
10- from typing import _GenericAlias as GenericAlias # type: ignore[name-defined]
11-
127import pygame
138from pygame import sprite
149
@@ -671,7 +666,7 @@ def test_type_subscript(self):
671666 except TypeError as e :
672667 self .fail (e )
673668
674- self .assertIsInstance (group_generic_alias , GenericAlias )
669+ self .assertIsInstance (group_generic_alias , types . GenericAlias )
675670 self .assertIs (typing .get_origin (group_generic_alias ), sprite .Group )
676671 self .assertEqual (typing .get_args (group_generic_alias ), (sprite .Sprite ,))
677672
You can’t perform that action at this time.
0 commit comments