@@ -50,6 +50,9 @@ msgid ""
5050"colon (``':'``) is missing before it. File name and line number are printed"
5151" so you know where to look in case the input came from a script."
5252msgstr ""
53+ "解析器会输出出现语法错误的那一行,并显示一个“箭头”,指向这行里面检测到第一个错误。 "
54+ "错误是由箭头指示的位置的*前面*的标识符引起的,也有可能是在这里才检测除了。:在示例中,在func:`print`这个函数中检测到错误:,因为少了个冒号"
55+ " (``':'``)。还会输出文件名和行号,以便输入来自脚本文件时知道错误在哪里。"
5356
5457#: ../../tutorial/errors.rst:37
5558msgid "Exceptions"
@@ -64,6 +67,9 @@ msgid ""
6467"not handled by programs, however, and result in error messages as shown "
6568"here::"
6669msgstr ""
70+ "即使语句或表达式在语法上是正确的,但在尝试执行它时可能会导致错误。 "
71+ "在执行期间检测到的错误被称为*异常*,异常不一定会导致严重后果:您将很快学会如何在Python程序中处理它们。 "
72+ "但是,大多数异常并不会被程序处理,此时会显示如下所示的错误信息::"
6773
6874#: ../../tutorial/errors.rst:58
6975msgid ""
@@ -76,12 +82,15 @@ msgid ""
7682" a useful convention). Standard exception names are built-in identifiers "
7783"(not reserved keywords)."
7884msgstr ""
85+ "错误信息的最后一行告诉我们程序遇到了什么类型的错误。异常有不同的类型,而其类型名称将会在错误信息中输出出来。上述样例中的异常类型依次是::exc:`ZeroDivisionError`,"
86+ " :exc:`NameError` and "
87+ ":exc:`TypeError`。错误信息中的异常类型是执行时抛出的内建异常类型。所有的内建类型都会如此,而虽然这是惯例,但是用户自定义的异常不一定如此。标准的异常类型是内建的标识符而非保留关键字。"
7988
8089#: ../../tutorial/errors.rst:66
8190msgid ""
8291"The rest of the line provides detail based on the type of exception and what"
8392" caused it."
84- msgstr ""
93+ msgstr "这一行剩下的部分能告诉我们此处抛出异常的具体类型以及哪一部分代码抛出了异常。 "
8594
8695#: ../../tutorial/errors.rst:69
8796msgid ""
0 commit comments