fix for Lib/test/test_future_stmt/test_future.py: test_annotations

This commit is contained in:
hydrogen602 2024-05-11 23:29:20 -05:00 committed by Jeong, YunWon
parent 649fdd4be9
commit 51b5f80ae3

View file

@ -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("]")?;