Fix build (#7437)
This commit is contained in:
@@ -38,7 +38,11 @@ impl FormatNodeRule<ExprCall> for FormatExprCall {
|
||||
|
||||
let fmt_func = format_with(|f: &mut PyFormatter| {
|
||||
// Format the function expression.
|
||||
if is_expression_parenthesized(func.into(), f.context().source()) {
|
||||
if is_expression_parenthesized(
|
||||
func.into(),
|
||||
f.context().comments().ranges(),
|
||||
f.context().source(),
|
||||
) {
|
||||
func.format().with_options(Parentheses::Always).fmt(f)
|
||||
} else {
|
||||
match func.as_ref() {
|
||||
|
||||
@@ -43,7 +43,11 @@ impl FormatNodeRule<ExprSubscript> for FormatExprSubscript {
|
||||
);
|
||||
|
||||
let format_inner = format_with(|f: &mut PyFormatter| {
|
||||
if is_expression_parenthesized(value.into(), f.context().source()) {
|
||||
if is_expression_parenthesized(
|
||||
value.into(),
|
||||
f.context().comments().ranges(),
|
||||
f.context().source(),
|
||||
) {
|
||||
value.format().with_options(Parentheses::Always).fmt(f)
|
||||
} else {
|
||||
match value.as_ref() {
|
||||
|
||||
Reference in New Issue
Block a user