Skip to content

Commit

Permalink
fix for Lib/test/test_future_stmt/test_future.py: test_annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrogen602 authored and youknowone committed May 12, 2024
1 parent 649fdd4 commit 51b5f80
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ast/src/unparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,7 @@ impl<'a> Unparser<'a> {
}
Expr::Subscript(crate::ExprSubscript { value, slice, .. }) => {
self.unparse_expr(value, precedence::ATOM)?;
let mut lvl = precedence::TUPLE;
if let Expr::Tuple(crate::ExprTuple { elts, .. }) = slice.as_ref() {
if elts.iter().any(|expr| expr.is_starred_expr()) {
lvl += 1
}
}
let lvl = precedence::TUPLE;
self.p("[")?;
self.unparse_expr(slice, lvl)?;
self.p("]")?;
Expand Down

0 comments on commit 51b5f80

Please sign in to comment.