Skip to content

Commit 6b74c23

Browse files
authored
Merge pull request yidao620c#295 from linchiwei123/patch-1
小修改
2 parents ed1dc44 + 5f06749 commit 6b74c23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/c08/p03_make_objects_support_context_management_protocol.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
最后,``__exit__()`` 方法被触发进行清理工作。
6262

6363
不管 ``with`` 代码块中发生什么,上面的控制流都会执行完,就算代码块中发生了异常也是一样的。
64-
事实上,``__exit__()`` 方法的第三个参数包含了异常类型、异常值和追溯信息(如果有的话)。
64+
事实上,``__exit__()`` 方法的三个参数包含了异常类型、异常值和追溯信息(如果有的话)。
6565
``__exit__()`` 方法能自己决定怎样利用这个异常信息,或者忽略它并返回一个None值。
6666
如果 ``__exit__()`` 返回 ``True`` ,那么异常会被清空,就好像什么都没发生一样,
6767
``with`` 语句后面的程序继续在正常执行。

0 commit comments

Comments
 (0)