diff --git a/parser/python.lalrpop b/parser/python.lalrpop index 3c980b0..cca2a46 100644 --- a/parser/python.lalrpop +++ b/parser/python.lalrpop @@ -439,7 +439,8 @@ TryStatement: ast::Stmt = { .last() .map(|last| last.end_location) .or_else(|| orelse.last().map(|last| last.end_location)) - .unwrap_or_else(|| handlers.last().unwrap().end_location); + .or_else(|| handlers.last().map(|last| last.end_location)) + .unwrap(); ast::Stmt { custom: (), location,