File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ def __repr__(self):
305305 return f"ForwardRef({ self .__forward_arg__ !r} { '' .join (extra )} )"
306306
307307
308- _Template = type (t "{1} " )
308+ _Template = type (t "" )
309309
310310
311311class _Stringifier :
@@ -575,7 +575,11 @@ def _template_to_ast(template):
575575 interp = ast .Interpolation (
576576 value = ast .parse (part .expression ),
577577 conversion = ord (part .conversion ) if part .conversion is not None else - 1 ,
578- format_spec = ast .Constant (value = part .format_spec ) if part .format_spec != "" else None ,
578+ format_spec = (
579+ ast .Constant (value = part .format_spec )
580+ if part .format_spec != ""
581+ else None
582+ ),
579583 )
580584 values .append (interp )
581585 return ast .TemplateStr (values = values )
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ extend-exclude = [
99 " encoded_modules/module_iso_8859_1.py" ,
1010 " encoded_modules/module_koi8_r.py" ,
1111 # SyntaxError because of t-strings
12- " test_tstring.py" ,
13- " test_string/test_templatelib.py" ,
1412 " test_annotationlib.py" ,
13+ " test_string/test_templatelib.py" ,
14+ " test_tstring.py" ,
1515 # New grammar constructions may not yet be recognized by Ruff,
1616 # and tests re-use the same names as only the grammar is being checked.
1717 " test_grammar.py" ,
You can’t perform that action at this time.
0 commit comments