File tree 1 file changed +2
-6
lines changed
1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 44
44
StrExpr ,
45
45
TempNode ,
46
46
TupleExpr ,
47
- Var ,
48
47
)
49
48
from mypy .parse import parse
50
49
from mypy .subtypes import is_subtype
51
50
from mypy .typeops import custom_special_method
52
51
from mypy .types import (
53
52
AnyType ,
54
- DeletedType ,
55
53
Instance ,
56
54
LiteralType ,
57
55
NoneType ,
58
56
TupleType ,
59
57
Type ,
60
58
TypeOfAny ,
61
- TypeType ,
62
59
TypeVarTupleType ,
63
60
TypeVarType ,
64
61
UnionType ,
@@ -457,12 +454,12 @@ def perform_special_format_checks(
457
454
# Perform type check of alignment specifiers on None
458
455
# If spec.format_spec is None then we use "" instead of avoid crashing
459
456
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 ):
461
458
arg = call .args [- 1 ].value
462
459
specifier_char = next ((c for c in (arg or "" ) if c in "<>^" ), None )
463
460
elif isinstance (spec .format_spec , str ):
464
461
specifier_char = next ((c for c in (spec .format_spec or "" ) if c in "<>^" ), None )
465
-
462
+
466
463
if specifier_char :
467
464
self .msg .fail (
468
465
(
@@ -473,7 +470,6 @@ def perform_special_format_checks(
473
470
call ,
474
471
code = codes .STRING_FORMATTING ,
475
472
)
476
-
477
473
478
474
def find_replacements_in_call (self , call : CallExpr , keys : list [str ]) -> list [Expression ]:
479
475
"""Find replacement expression for every specifier in str.format() call.
You can’t perform that action at this time.
0 commit comments