diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py index 391c7a59d60b..b05f9168ee12 100644 --- a/mypy/checkexpr.py +++ b/mypy/checkexpr.py @@ -2205,7 +2205,7 @@ def visit_op_expr(self, e: OpExpr) -> Type: return self.strfrm_checker.check_str_interpolation(e.left, e.right) if isinstance(e.left, StrExpr): return self.strfrm_checker.check_str_interpolation(e.left, e.right) - elif pyversion[0] <= 2: + elif pyversion[0] == 2: if isinstance(e.left, (StrExpr, BytesExpr, UnicodeExpr)): return self.strfrm_checker.check_str_interpolation(e.left, e.right) left_type = self.accept(e.left)