From 5e5a96ca281995c1b85dad02a175df0f41fa836b Mon Sep 17 00:00:00 2001 From: konsti Date: Thu, 6 Jul 2023 20:23:53 +0200 Subject: [PATCH] Fix formatter `StmtTry` test (#5568) For some reason this didn't turn up on CI before CC @michareiser this is the fix for the error you had --- .../snapshots/format@statement__try.py.snap | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/crates/ruff_python_formatter/tests/snapshots/format@statement__try.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@statement__try.py.snap index 588c6e5b50..eb3717b299 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@statement__try.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@statement__try.py.snap @@ -95,6 +95,16 @@ else: # before finally finally: ... + +# try and try star are statements with body +# Minimized from https://github.com/python/cpython/blob/99b00efd5edfd5b26bf9e2a35cbfc96277fdcbb1/Lib/getpass.py#L68-L91 +try: + try: + pass + finally: + print(1) # issue7208 +except A: + pass ``` ## Output @@ -200,6 +210,16 @@ else: # before finally finally: ... + +# try and try star are statements with body +# Minimized from https://github.com/python/cpython/blob/99b00efd5edfd5b26bf9e2a35cbfc96277fdcbb1/Lib/getpass.py#L68-L91 +try: + try: + pass + finally: + print(1) # issue7208 +except A: + pass ```