Skip to content

Commit d46f562

Browse files
Fix lint error
1 parent c979af9 commit d46f562

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

mypy/checkstrformat.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,18 @@
4444
StrExpr,
4545
TempNode,
4646
TupleExpr,
47-
Var,
4847
)
4948
from mypy.parse import parse
5049
from mypy.subtypes import is_subtype
5150
from mypy.typeops import custom_special_method
5251
from 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.

0 commit comments

Comments
 (0)