@@ -1216,7 +1216,10 @@ def _enter_annotation(self, ann_type=AnnotationState.BARE):
12161216 def _in_postponed_annotation (self ):
12171217 return (
12181218 self ._in_annotation == AnnotationState .STRING or
1219- self .annotationsFutureEnabled
1219+ (
1220+ self ._in_annotation == AnnotationState .BARE and
1221+ (self .annotationsFutureEnabled or sys .version_info >= (3 , 14 ))
1222+ )
12201223 )
12211224
12221225 def handleChildren (self , tree , omit = None ):
@@ -1350,7 +1353,7 @@ def handleAnnotation(self, annotation, node):
13501353 annotation .col_offset ,
13511354 messages .ForwardAnnotationSyntaxError ,
13521355 ))
1353- elif self .annotationsFutureEnabled :
1356+ elif self .annotationsFutureEnabled or sys . version_info >= ( 3 , 14 ) :
13541357 self .handle_annotation_always_deferred (annotation , node )
13551358 else :
13561359 self .handleNode (annotation , node )
@@ -1776,6 +1779,20 @@ def JOINEDSTR(self, node):
17761779 finally :
17771780 self ._in_fstring = orig
17781781
1782+ def TEMPLATESTR (self , node ):
1783+ if not any (isinstance (x , ast .Interpolation ) for x in node .values ):
1784+ self .report (messages .TStringMissingPlaceholders , node )
1785+
1786+ # similar to f-strings, conversion / etc. flags are parsed as f-strings
1787+ # without placeholders
1788+ self ._in_fstring , orig = True , self ._in_fstring
1789+ try :
1790+ self .handleChildren (node )
1791+ finally :
1792+ self ._in_fstring = orig
1793+
1794+ INTERPOLATION = handleChildren
1795+
17791796 def DICT (self , node ):
17801797 # Complain if there are duplicate keys with different values
17811798 # If they have the same value it's not going to cause potentially
0 commit comments