Format StmtTry (#5222)

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
David Szotten 2023-06-28 11:02:15 +01:00 committed by GitHub
parent 9e2fd0c620
commit 1979103ec0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 583 additions and 123 deletions

View file

@ -0,0 +1,72 @@
try:
...
except:
...
try:
...
except (KeyError): # should remove brackets and be a single line
...
try: # try
...
# end of body
# before except
except (Exception, ValueError) as exc: # except line
...
# before except 2
except KeyError as key: # except line 2
...
# in body 2
# before else
else:
...
# before finally
finally:
...
# with line breaks
try: # try
...
# end of body
# before except
except (Exception, ValueError) as exc: # except line
...
# before except 2
except KeyError as key: # except line 2
...
# in body 2
# before else
else:
...
# before finally
finally:
...
# with line breaks
try:
...
except:
...
try:
...
except (Exception, Exception, Exception, Exception, Exception, Exception, Exception) as exc: # splits exception over multiple lines
...
try:
...
except:
a = 10 # trailing comment1
b = 11 # trailing comment2