@@ -11,7 +11,7 @@ msgid ""
11
11
msgstr ""
12
12
"Project-Id-Version : Python 3.12\n "
13
13
"Report-Msgid-Bugs-To : \n "
14
- "POT-Creation-Date : 2024-05-11 19:07 +0000\n "
14
+ "POT-Creation-Date : 2024-08-31 11:30 +0000\n "
15
15
"PO-Revision-Date : 2024-05-11 00:32+0000\n "
16
16
"
Last-Translator :
Rafael Fontenelle <[email protected] >, 2024\n "
17
17
"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -71,13 +71,11 @@ msgstr ""
71
71
72
72
#: ../../c-api/exceptions.rst:37
73
73
msgid ""
74
- "The error indicator is **not** the result of :func:`sys.exc_info() `. The "
74
+ "The error indicator is **not** the result of :func:`sys.exc_info`. The "
75
75
"former corresponds to an exception that is not yet caught (and is therefore "
76
76
"still propagating), while the latter returns an exception after it is caught"
77
77
" (and has therefore stopped propagating)."
78
78
msgstr ""
79
- "错误指示器 **不是** :func:`sys.exc_info()` "
80
- "的执行结果。前者对应尚未捕获的异常(异常还在传播),而后者在捕获异常后返回这个异常(异常已经停止传播)。"
81
79
82
80
#: ../../c-api/exceptions.rst:44
83
81
msgid "Printing and clearing"
@@ -569,6 +567,17 @@ msgstr "此函数会被需要捕获异常的代码,或需要临时保存和恢
569
567
msgid "For example::"
570
568
msgstr "例如:"
571
569
570
+ #: ../../c-api/exceptions.rst:438
571
+ msgid ""
572
+ "{\n"
573
+ " PyObject *exc = PyErr_GetRaisedException();\n"
574
+ "\n"
575
+ " /* ... code that might produce other errors ... */\n"
576
+ "\n"
577
+ " PyErr_SetRaisedException(exc);\n"
578
+ "}"
579
+ msgstr ""
580
+
572
581
#: ../../c-api/exceptions.rst:446
573
582
msgid ""
574
583
":c:func:`PyErr_GetHandledException`, to save the exception currently being "
@@ -607,6 +616,18 @@ msgid ""
607
616
"exceptions or save and restore the error indicator temporarily."
608
617
msgstr "此函数通常只被需要捕获异常或临时保存和恢复错误指示符的旧式代码所使用。"
609
618
619
+ #: ../../c-api/exceptions.rst:482
620
+ msgid ""
621
+ "{\n"
622
+ " PyObject *type, *value, *traceback;\n"
623
+ " PyErr_Fetch(&type, &value, &traceback);\n"
624
+ "\n"
625
+ " /* ... code that might produce other errors ... */\n"
626
+ "\n"
627
+ " PyErr_Restore(type, value, traceback);\n"
628
+ "}"
629
+ msgstr ""
630
+
610
631
#: ../../c-api/exceptions.rst:496
611
632
msgid "Use :c:func:`PyErr_SetRaisedException` instead."
612
633
msgstr "请改用 :c:func:`PyErr_SetRaisedException`。"
@@ -664,6 +685,13 @@ msgstr ""
664
685
"此函数 *不会* 隐式地在异常值上设置 :attr:`~BaseException.__traceback__` 属性。 "
665
686
"如果想要适当地设置回溯,还需要以下附加代码片段::"
666
687
688
+ #: ../../c-api/exceptions.rst:537
689
+ msgid ""
690
+ "if (tb != NULL) {\n"
691
+ " PyException_SetTraceback(val, tb);\n"
692
+ "}"
693
+ msgstr ""
694
+
667
695
#: ../../c-api/exceptions.rst:544
668
696
msgid ""
669
697
"Retrieve the active exception instance, as would be returned by "
0 commit comments