Skip to content

Commit d39efb8

Browse files
authored
Move the target assignment in the try clause
1 parent 41b99c1 commit d39efb8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/reference/compound_stmts.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,10 @@ is semantically equivalent to::
443443
enter = type(manager).__enter__
444444
exit = type(manager).__exit__
445445
value = enter(manager)
446-
target = value # only if `as target` is present in the with statement
447446
exception = False
448447

449448
try:
449+
target = value # only if `as target` is present in the with statement
450450
suite
451451
except:
452452
exception = True
@@ -846,10 +846,10 @@ is semantically equivalent to::
846846
aexit = type(manager).__aexit__
847847
aenter = type(manager).__aenter__
848848
value = await aenter(manager)
849-
target = value # only if `as target` is present in the with statement
850849
exception = False
851850

852851
try:
852+
target = value # only if `as target` is present in the with statement
853853
suite
854854
except:
855855
exception = True

0 commit comments

Comments
 (0)