File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -202,6 +202,8 @@ msgid ""
202202"message and then re-raise the exception (allowing a caller to handle the "
203203"exception as well)::"
204204msgstr ""
205+ "最后的 except "
206+ "子句可以省略异常名,以用作通配符。但请谨慎使用,因为以这种方式很容易掩盖真正的编程错误!它还可用于打印错误消息,然后重新引发异常(同样允许调用者处理异常)::"
205207
206208#: ../../tutorial/errors.rst:169
207209msgid ""
@@ -210,6 +212,8 @@ msgid ""
210212"for code that must be executed if the try clause does not raise an "
211213"exception. For example::"
212214msgstr ""
215+ ":keyword:`try` ... :keyword:`except` 语句有一个可选的 *else 子句*,在使用时必须放在所有的 except "
216+ "子句后面。对于在try 子句不引发异常时必须执行的代码来说很有用。例如::"
213217
214218#: ../../tutorial/errors.rst:183
215219msgid ""
@@ -218,6 +222,8 @@ msgid ""
218222"exception that wasn't raised by the code being protected by the "
219223":keyword:`try` ... :keyword:`except` statement."
220224msgstr ""
225+ "使用 :keyword:`else` 子句比向 :keyword:`try` 子句添加额外的代码要好,因为它避免了意外捕获由 "
226+ ":keyword:`try` ... :keyword:`except` 语句保护的代码未引发的异常。"
221227
222228#: ../../tutorial/errors.rst:188
223229msgid ""
You can’t perform that action at this time.
0 commit comments