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 4444 StrExpr ,
4545 TempNode ,
4646 TupleExpr ,
47- Var ,
4847)
4948from mypy .parse import parse
5049from mypy .subtypes import is_subtype
5150from mypy .typeops import custom_special_method
5251from mypy .types import (
5352 AnyType ,
54- DeletedType ,
5553 Instance ,
5654 LiteralType ,
5755 NoneType ,
5856 TupleType ,
5957 Type ,
6058 TypeOfAny ,
61- TypeType ,
6259 TypeVarTupleType ,
6360 TypeVarType ,
6461 UnionType ,
@@ -457,12 +454,12 @@ def perform_special_format_checks(
457454 # Perform type check of alignment specifiers on None
458455 # If spec.format_spec is None then we use "" instead of avoid crashing
459456 specifier_char = None
460- if spec .non_standard_format_spec == True and isinstance (call .args [- 1 ], StrExpr ):
457+ if spec .non_standard_format_spec and isinstance (call .args [- 1 ], StrExpr ):
461458 arg = call .args [- 1 ].value
462459 specifier_char = next ((c for c in (arg or "" ) if c in "<>^" ), None )
463460 elif isinstance (spec .format_spec , str ):
464461 specifier_char = next ((c for c in (spec .format_spec or "" ) if c in "<>^" ), None )
465-
462+
466463 if specifier_char :
467464 self .msg .fail (
468465 (
@@ -473,7 +470,6 @@ def perform_special_format_checks(
473470 call ,
474471 code = codes .STRING_FORMATTING ,
475472 )
476-
477473
478474 def find_replacements_in_call (self , call : CallExpr , keys : list [str ]) -> list [Expression ]:
479475 """Find replacement expression for every specifier in str.format() call.
You can’t perform that action at this time.
0 commit comments