Skip to content

Commit be1aa18

Browse files
authored
Rename a variable
1 parent d39efb8 commit be1aa18

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Doc/reference/compound_stmts.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -443,17 +443,17 @@ is semantically equivalent to::
443443
enter = type(manager).__enter__
444444
exit = type(manager).__exit__
445445
value = enter(manager)
446-
exception = False
446+
hit_except = False
447447

448448
try:
449449
target = value # only if `as target` is present in the with statement
450450
suite
451451
except:
452-
exception = True
452+
hit_except = True
453453
if not exit(manager, *sys.exc_info()):
454454
raise
455455
finally:
456-
if not exception:
456+
if not hit_except:
457457
exit(manager, None, None, None)
458458

459459
With more than one item, the context managers are processed as if multiple
@@ -846,17 +846,17 @@ is semantically equivalent to::
846846
aexit = type(manager).__aexit__
847847
aenter = type(manager).__aenter__
848848
value = await aenter(manager)
849-
exception = False
849+
hit_except = False
850850

851851
try:
852852
target = value # only if `as target` is present in the with statement
853853
suite
854854
except:
855-
exception = True
855+
hit_except = True
856856
if not await aexit(manager, *sys.exc_info()):
857857
raise
858858
finally:
859-
if not exception:
859+
if not hit_except:
860860
await aexit(manager, None, None, None)
861861

862862
See also :meth:`__aenter__` and :meth:`__aexit__` for details.

0 commit comments

Comments
 (0)