@@ -104,16 +104,16 @@ msgid ""
104104"exception happened, in the form of a stack traceback. In general it contains"
105105" a stack traceback listing source lines; however, it will not display lines "
106106"read from standard input."
107- msgstr ""
107+ msgstr "错误信息的前一部分以堆栈回溯的形式显示发生异常时的上下文。通常它包含列出源代码行的堆栈回溯;但是它不会显示从标准输入中读取的行。 "
108108
109109#: ../../tutorial/errors.rst:74
110110msgid ""
111111":ref:`bltin-exceptions` lists the built-in exceptions and their meanings."
112- msgstr ""
112+ msgstr ":ref:`bltin-exceptions` 列出了内置异常和它们的含义。 "
113113
114114#: ../../tutorial/errors.rst:80
115115msgid "Handling Exceptions"
116- msgstr ""
116+ msgstr "处理异常 "
117117
118118#: ../../tutorial/errors.rst:82
119119msgid ""
@@ -124,22 +124,24 @@ msgid ""
124124"user-generated interruption is signalled by raising the "
125125":exc:`KeyboardInterrupt` exception. ::"
126126msgstr ""
127+ "可以编写处理所选异常的程序。请看下面的例子,它会要求用户一直输入,直到输入的是一个有效的整数,但允许用户中断程序(使用 :kbd:`Control-C`"
128+ " 或操作系统支持的其他操作);请注意用户引起的中断可以通过引发 :exc:`KeyboardInterrupt` 异常来指示。::"
127129
128130#: ../../tutorial/errors.rst:96
129131msgid "The :keyword:`try` statement works as follows."
130- msgstr ""
132+ msgstr ":keyword:`try` 语句的工作原理如下。 "
131133
132134#: ../../tutorial/errors.rst:98
133135msgid ""
134136"First, the *try clause* (the statement(s) between the :keyword:`try` and "
135137":keyword:`except` keywords) is executed."
136- msgstr ""
138+ msgstr "首先,执行 *try 子句* (:keyword:`try` 和 :keyword:`except` 关键字之间的(多行)语句)。 "
137139
138140#: ../../tutorial/errors.rst:101
139141msgid ""
140142"If no exception occurs, the *except clause* is skipped and execution of the "
141143":keyword:`try` statement is finished."
142- msgstr ""
144+ msgstr "如果没有异常发生,则跳过 *except 子句* 并完成 :keyword:`try` 语句的执行。 "
143145
144146#: ../../tutorial/errors.rst:104
145147msgid ""
@@ -148,6 +150,8 @@ msgid ""
148150":keyword:`except` keyword, the except clause is executed, and then execution"
149151" continues after the :keyword:`try` statement."
150152msgstr ""
153+ "如果在执行try 子句时发生了异常,则跳过该子句中剩下的部分。然后,如果异常的类型和 :keyword:`except` 关键字后面的异常匹配,则执行 "
154+ "except 子句 ,然后继续执行 :keyword:`try` 语句之后的代码。"
151155
152156#: ../../tutorial/errors.rst:109
153157msgid ""
@@ -156,6 +160,8 @@ msgid ""
156160"handler is found, it is an *unhandled exception* and execution stops with a "
157161"message as shown above."
158162msgstr ""
163+ "如果发生的异常和 except 子句中指定的异常不匹配,则将其传递到外部的 :keyword:`try` 语句中;如果没有找到处理程序,则它是一个 "
164+ "*未处理异常*,执行将停止并显示如上所示的消息。"
159165
160166#: ../../tutorial/errors.rst:114
161167msgid ""
@@ -165,6 +171,9 @@ msgid ""
165171"not in other handlers of the same :keyword:`try` statement. An except "
166172"clause may name multiple exceptions as a parenthesized tuple, for example::"
167173msgstr ""
174+ "一个:keyword:`try` 语句可能有多个 except 子句,以指定不同异常的处理程序。最多将执行一个处理程序。处理程序只处理相应的 try "
175+ "子句中发生的异常,而不处理同一 :keyword:`try` 语句中的其他处理程序中的异常。一个except "
176+ "子句可以将多个异常命名为带括号的元组,例如::"
168177
169178#: ../../tutorial/errors.rst:123
170179msgid ""
0 commit comments