# Buggy code
def check_simple_str_interpolation(
    self, specifiers: List[ConversionSpecifier], replacements: Expression
) -> None:
    checkers = self.build_replacement_checkers(specifiers, replacements)
    if checkers is None:
        return

    rhs_type = self.accept(replacements)
    rep_types = []  # type: List[Type]
    if isinstance(rhs_type, TupleType):
        rep_types = rhs_type.items
    elif isinstance(rhs_type, AnyType):
        return
    else:
        rep_types = [rhs_type]

    if len(checkers) > len(rep_types):
        self.msg.too_few_string_formatting_arguments(replacements)
    elif len(checkers) < len(rep_types):
        self.msg.too_many_string_formatting_arguments(replacements)
    else:
        if len(checkers) == 1:
            check_node, check_type = checkers[0]
            if isinstance(rhs_type, TupleType) and len(rhs_type.items) == 1:
                check_type(rhs_type.items[0])
            else:
                check_node(replacements)
        elif isinstance(replacements, TupleExpr):
            for checks, rep_node in zip(checkers, replacements.items):
                check_node, check_type = checks
                check_node(rep_node)
        else:
            for checks, rep_type in zip(checkers, rep_types):
                check_node, check_type = checks
                check_type(rep_type)


# Traceback (AttributeError)
Traceback (most recent call last):
File "/usr/local/bin/mypy", line 6, in <module>
main(__file__)
File "/usr/local/lib/python3.6/site-packages/mypy/main.py", line 42, in main
res = type_check_only(sources, bin_dir, options)
File "/usr/local/lib/python3.6/site-packages/mypy/main.py", line 87, in type_check_only
options=options)
File "/usr/local/lib/python3.6/site-packages/mypy/build.py", line 183, in build
dispatch(sources, manager)
File "/usr/local/lib/python3.6/site-packages/mypy/build.py", line 1526, in dispatch
process_graph(graph, manager)
File "/usr/local/lib/python3.6/site-packages/mypy/build.py", line 1762, in process_graph
process_stale_scc(graph, scc)
File "/usr/local/lib/python3.6/site-packages/mypy/build.py", line 1841, in process_stale_scc
graph[id].type_check_first_pass()
File "/usr/local/lib/python3.6/site-packages/mypy/build.py", line 1451, in type_check_first_pass
self.type_checker.check_first_pass()
File "/usr/local/lib/python3.6/site-packages/mypy/checker.py", line 175, in check_first_pass
self.accept(d)
File "/usr/local/lib/python3.6/site-packages/mypy/checker.py", line 247, in accept
typ = node.accept(self)
File "/usr/local/lib/python3.6/site-packages/mypy/nodes.py", line 788, in accept
return visitor.visit_expression_stmt(self)
File "/usr/local/lib/python3.6/site-packages/mypy/checker.py", line 1596, in visit_expression_stmt
self.accept(s.expr)
File "/usr/local/lib/python3.6/site-packages/mypy/checker.py", line 247, in accept
typ = node.accept(self)
File "/usr/local/lib/python3.6/site-packages/mypy/nodes.py", line 1400, in accept
return visitor.visit_op_expr(self)
File "/usr/local/lib/python3.6/site-packages/mypy/checker.py", line 2160, in visit_op_expr
return self.expr_checker.visit_op_expr(e)
File "/usr/local/lib/python3.6/site-packages/mypy/checkexpr.py", line 1110, in visit_op_expr
return self.strfrm_checker.check_str_interpolation(e.left, e.right)
File "/usr/local/lib/python3.6/site-packages/mypy/checkstrformat.py", line 74, in check_str_interpolation
self.check_simple_str_interpolation(specifiers, replacements)
File "/usr/local/lib/python3.6/site-packages/mypy/checkstrformat.py", line 146, in check_simple_str_interpolation
check_node(rep_node)
File "/usr/local/lib/python3.6/site-packages/mypy/checkstrformat.py", line 255, in check_expr
check_type(type)
File "/usr/local/lib/python3.6/site-packages/mypy/checkstrformat.py", line 251, in check_type
'expression has type', 'placeholder has type')
File "/usr/local/lib/python3.6/site-packages/mypy/checker.py", line 2273, in check_subtype
if is_subtype(subtype, supertype):
File "/usr/local/lib/python3.6/site-packages/mypy/subtypes.py", line 54, in is_subtype
for item in right.items)
File "/usr/local/lib/python3.6/site-packages/mypy/subtypes.py", line 54, in <genexpr>
for item in right.items)
File "/usr/local/lib/python3.6/site-packages/mypy/subtypes.py", line 56, in is_subtype
return left.accept(SubtypeVisitor(right, type_parameter_checker,
AttributeError: 'NoneType' object has no attribute 'accept'

# Fixed code
def check_simple_str_interpolation(
    self, specifiers: List[ConversionSpecifier], replacements: Expression
) -> None:
    checkers = self.build_replacement_checkers(specifiers, replacements)
    if checkers is None:
        return

    rhs_type = self.accept(replacements)
    rep_types = []  # type: List[Type]
    if isinstance(rhs_type, TupleType):
        rep_types = rhs_type.items
    elif isinstance(rhs_type, AnyType):
        return
    else:
        rep_types = [rhs_type]

    if len(checkers) > len(rep_types):
        self.msg.too_few_string_formatting_arguments(replacements)
    elif len(checkers) < len(rep_types):
        self.msg.too_many_string_formatting_arguments(replacements)
    else:
        if len(checkers) == 1:
            check_node, check_type = checkers[0]
            if isinstance(rhs_type, TupleType) and len(rhs_type.items) == 1:
                check_type(rhs_type.items[0])
            else:
                check_node(replacements)
        elif isinstance(replacements, TupleExpr) and not any(
            isinstance(item, StarExpr) for item in replacements.items
        ):
            for checks, rep_node in zip(checkers, replacements.items):
                check_node, check_type = checks
                check_node(rep_node)
        else:
            for checks, rep_type in zip(checkers, rep_types):
                check_node, check_type = checks
                check_type(rep_type)