@@ -292,6 +292,8 @@ msgid ""
292292"<traceback-objects>` *tb* by calling the :meth:`~frame.clear` method of each"
293293" :ref:`frame object <frame-objects>`."
294294msgstr ""
295+ "通过调用每个 :ref:`帧对象 <frame-objects>` 的 :meth:`~frame.clear` 方法来清除 :ref:`回溯 "
296+ "<traceback-objects>` *tb* 中所有栈帧的局部变量。"
295297
296298#: ../../library/traceback.rst:210
297299msgid ""
@@ -300,13 +302,17 @@ msgid ""
300302"current stack is used. This helper is used with "
301303":meth:`StackSummary.extract`."
302304msgstr ""
305+ "从给定的帧开始访问 :attr:`f.f_back <frame.f_back>` 之后的栈内容,产生每一个帧和帧对应的行号。 如果 *f* 为 "
306+ "``None``,则会使用当前栈。 这个辅助函数要与 :meth:`StackSummary.extract` 一起使用。"
303307
304308#: ../../library/traceback.rst:219
305309msgid ""
306310"Walk a traceback following :attr:`~traceback.tb_next` yielding the frame and"
307311" line number for each frame. This helper is used with "
308312":meth:`StackSummary.extract`."
309313msgstr ""
314+ "访问 :attr:`~traceback.tb_next` 之后的回溯并产生每一个帧和帧对应的行号。 这个辅助函数要与 "
315+ ":meth:`StackSummary.extract` 一起使用。"
310316
311317#: ../../library/traceback.rst:225
312318msgid "The module also defines the following classes:"
@@ -384,19 +390,23 @@ msgid ""
384390":class:`!TracebackException` instances representing the nested exceptions. "
385391"Otherwise it is ``None``."
386392msgstr ""
393+ "如果 ``self`` 代表一个 :exc:`ExceptionGroup`,此字段将保存一个由代表被嵌套异常的 "
394+ ":class:`!TracebackException` 实例组成的列表。 否则它将为 ``None``。"
387395
388396#: ../../library/traceback.rst:280
389397msgid ""
390398"The :attr:`~BaseException.__suppress_context__` value from the original "
391399"exception."
392- msgstr ""
400+ msgstr "来自原始异常的 :attr:`~BaseException.__suppress_context__` 值。 "
393401
394402#: ../../library/traceback.rst:285
395403msgid ""
396404"The :attr:`~BaseException.__notes__` value from the original exception, or "
397405"``None`` if the exception does not have any notes. If it is not ``None`` is "
398406"it formatted in the traceback after the exception string."
399407msgstr ""
408+ "来自原始异常的 :attr:`~BaseException.__notes__` 值,或者如果异常没有任何注释则为 ``None``。 如果它不为 "
409+ "``None`` 则会在异常字符串之后的回溯中进行格式化。"
400410
401411#: ../../library/traceback.rst:294
402412msgid "A :class:`StackSummary` representing the traceback."
@@ -495,13 +505,15 @@ msgstr ":class:`!StackSummary` 对象"
495505#: ../../library/traceback.rst:382
496506msgid ""
497507":class:`!StackSummary` objects represent a call stack ready for formatting."
498- msgstr ""
508+ msgstr ":class:`!StackSummary` 对象代表一个可被格式化的调用栈。 "
499509
500510#: ../../library/traceback.rst:388
501511msgid ""
502512"Construct a :class:`!StackSummary` object from a frame generator (such as is"
503513" returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)."
504514msgstr ""
515+ "根据一个帧生成器(例如由 :func:`~traceback.walk_stack` 或 :func:`~traceback.walk_tb` "
516+ "所返回的对象)构造 :class:`!StackSummary` 对象。"
505517
506518#: ../../library/traceback.rst:392
507519msgid ""
@@ -512,6 +524,10 @@ msgid ""
512524" get formatted). If *capture_locals* is ``True`` the local variables in each"
513525" :class:`!FrameSummary` are captured as object representations."
514526msgstr ""
527+ "如果提供了 *limit*,则只从 *frame_gen* 提取该参数所指定数量的帧。 如果 *lookup_lines* 为 "
528+ "``False``,则返回的 :class:`FrameSummary` 对象将不会读入它们的行,这使得创建 "
529+ ":class:`!StackSummary` 的开销更低(如果它不会被实际格式化这就很有价值)。 如果 *capture_locals* 为 "
530+ "``True`` 则每个 :class:`!FrameSummary` 中的局部变量会被捕获为对象表示形式。"
515531
516532#: ../../library/traceback.rst:400
517533msgid ""
@@ -527,6 +543,8 @@ msgid ""
527543"should be a 4-tuple with *filename*, *lineno*, *name*, *line* as the "
528544"elements."
529545msgstr ""
546+ "从所提供的 :class:`FrameSummary` 对象列表或旧式的元组列表构造一个 :class:`!StackSummary` 对象。 "
547+ "每个元组都应当是以 *文件名*, *行号*, *名称*, *行* 为元素的 4 元组。"
530548
531549#: ../../library/traceback.rst:413
532550msgid ""
@@ -535,6 +553,8 @@ msgid ""
535553"Each string ends in a newline; the strings may contain internal newlines as "
536554"well, for those items with source text lines."
537555msgstr ""
556+ "返回一个可打印的字符串列表。 结果列表中的每个字符串各自对应来自栈的单独的 :ref:`帧 <frame-objects>`。 "
557+ "每个字符串都以一个换行符结束;对于带有源文本行的条目来说,字符串还可能包含内部换行符。"
538558
539559#: ../../library/traceback.rst:419
540560msgid ""
@@ -554,16 +574,21 @@ msgid ""
554574"object to be printed by :meth:`StackSummary.format`. If it returns ``None``,"
555575" the frame is omitted from the output."
556576msgstr ""
577+ "返回用于打印栈中涉及的某一个 :ref:`帧 <frame-objects>` 的字符串。 此方法会为每个要用 "
578+ ":meth:`StackSummary.format` 来打印的 :class:`FrameSummary` 对象进行调用。 如果它返回 "
579+ "``None``,该帧将从输出中被省略。"
557580
558581#: ../../library/traceback.rst:438
559582msgid ":class:`!FrameSummary` Objects"
560- msgstr ""
583+ msgstr ":class:`!FrameSummary` 对象 "
561584
562585#: ../../library/traceback.rst:442
563586msgid ""
564587"A :class:`!FrameSummary` object represents a single :ref:`frame <frame-"
565588"objects>` in a :ref:`traceback <traceback-objects>`."
566589msgstr ""
590+ ":class:`!FrameSummary` 对象表示 :ref:`回溯 <traceback-objects>` 中的某一个 :ref:`帧 "
591+ "<frame-objects>`。"
567592
568593#: ../../library/traceback.rst:447
569594msgid ""
@@ -605,7 +630,7 @@ msgid ""
605630"A string representing the source code for this frame, with leading and "
606631"trailing whitespace stripped. If the source is not available, it is "
607632"``None``."
608- msgstr ""
633+ msgstr "代表该帧的源代码的字符串,开头和末尾的空白将被去除。 如果源代码不可用,它将为 ``None``。 "
609634
610635#: ../../library/traceback.rst:484
611636msgid "Traceback Examples"
0 commit comments