File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -862,7 +862,6 @@ class Checker(object):
862
862
offset = None
863
863
traceTree = False
864
864
_in_annotation = AnnotationState .NONE
865
- _in_typing_literal = False
866
865
_in_deferred = False
867
866
868
867
builtIns = set (builtin_vars ).union (_MAGIC_GLOBALS )
@@ -1505,11 +1504,8 @@ def ignore(self, node):
1505
1504
1506
1505
def SUBSCRIPT (self , node ):
1507
1506
if _is_name_or_attr (node .value , 'Literal' ):
1508
- orig , self ._in_typing_literal = self ._in_typing_literal , True
1509
- try :
1507
+ with self ._enter_annotation (AnnotationState .NONE ):
1510
1508
self .handleChildren (node )
1511
- finally :
1512
- self ._in_typing_literal = orig
1513
1509
elif _is_name_or_attr (node .value , 'Annotated' ):
1514
1510
self .handleNode (node .value , node )
1515
1511
@@ -1794,7 +1790,7 @@ def BINOP(self, node):
1794
1790
self .handleChildren (node )
1795
1791
1796
1792
def STR (self , node ):
1797
- if self ._in_annotation and not self . _in_typing_literal :
1793
+ if self ._in_annotation :
1798
1794
fn = functools .partial (
1799
1795
self .handleStringAnnotation ,
1800
1796
node .s ,
You can’t perform that action at this time.
0 commit comments