Skip to content

Commit 75bbb59

Browse files
[po] auto sync
1 parent 574e484 commit 75bbb59

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

c-api/intro.po

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,9 @@ msgid ""
580580
"the value of a complex number. These will be discussed together with the "
581581
"functions that use them."
582582
msgstr ""
583+
"在 Python/C API 中扮演重要角色的其他数据类型很少;大多为简单 C 类型如 :c:type:`int`, :c:type:`long`, "
584+
":c:type:`double` 和 :c:type:`char*`。 "
585+
"有一些结构类型被用来描述用于列出模块导出的函数或者某个新对象类型的静态表,还有一个结构类型被用来描述复数的值。 这些结构类型将与使用它们的函数一起讨论。"
583586

584587
#: ../../c-api/intro.rst:496
585588
msgid "Exceptions"
@@ -609,6 +612,11 @@ msgid ""
609612
"for errors with :c:func:`PyErr_Occurred`. These exceptions are always "
610613
"explicitly documented."
611614
msgstr ""
615+
"然而,对于 C 程序员来说,错误检查必须总是显式进行的。 Python/C API 中的所有函数都可以引发异常,除非在函数的文档中另外显式声明。 "
616+
"一般来说,当一个函数遇到错误时,它会设置一个异常,丢弃它所拥有的任何对象引用,并返回一个错误标示。 如果没有说明例外的文档,这个标示将为 "
617+
"``NULL`` 或 ``-1``,具体取决于函数的返回类型。 有少量函数会返回一个布尔真/假结果值,其中假值表示错误。 "
618+
"有极少的函数没有显式的错误标示或是具有不明确的返回值,并需要用 :c:func:`PyErr_Occurred` 来进行显式的检测。 "
619+
"这些异常总是会被明确地记入文档中。"
612620

613621
#: ../../c-api/intro.rst:521
614622
msgid ""
@@ -622,6 +630,10 @@ msgid ""
622630
"not the most general) function to set the exception state, and "
623631
":c:func:`PyErr_Clear` clears the exception state."
624632
msgstr ""
633+
"异常状态是在各个线程的存储中维护的(这相当于在一个无线程的应用中使用全局存储)。 一个线程可以处在两种状态之一:异常已经发生,或者没有发生。 函数 "
634+
":c:func:`PyErr_Occurred` 可以被用来检查此状态:当异常发生时它将返回一个借入的异常类型对象的引用,在其他情况下则返回 "
635+
"``NULL``。 有多个函数可以设置异常状态: :c:func:`PyErr_SetString` "
636+
"是最常见的(尽管不是最通用的)设置异常状态的函数,而 :c:func:`PyErr_Clear` 可以清除异常状态。"
625637

626638
#: ../../c-api/intro.rst:531
627639
msgid ""
@@ -635,6 +647,10 @@ msgid ""
635647
"the Python bytecode interpreter's main loop, which takes care of "
636648
"transferring it to ``sys.exc_info()`` and friends."
637649
msgstr ""
650+
"完整的异常状态由三个对象组成 (它为都可以为 ``NULL``): 异常类型、相应的异常值,以及回溯信息。 这些对象的含义与 Python 中 "
651+
"``sys.exc_info()`` 的结果相同;然而,它们并不是一样的:Python 对象代表由 Python :keyword:`try` ..."
652+
" :keyword:`except` 语句所处理的最后一个异常,而 C 层级的异常状态只在异常被传入到 C 函数或在它们之间传递时存在直至其到达 "
653+
"Python 字节码解释器的主事件循环,该事件循环会负责将其转移至 ``sys.exc_info()`` 等处。"
638654

639655
#: ../../c-api/intro.rst:543
640656
msgid ""

library/imp.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55
#
66
# Translators:
7-
# Freesand Leo <yuqinju@163.com>, 2020
87
# nick <2330458484@qq.com>, 2020
98
# leollon <mssm.good@outlook.com>, 2020
109
# Dai Xu <daixu61@hotmail.com>, 2021
10+
# Freesand Leo <yuqinju@163.com>, 2022
1111
#
1212
#, fuzzy
1313
msgid ""
@@ -16,7 +16,7 @@ msgstr ""
1616
"Report-Msgid-Bugs-To: \n"
1717
"POT-Creation-Date: 2021-01-01 16:06+0000\n"
1818
"PO-Revision-Date: 2020-05-30 12:04+0000\n"
19-
"Last-Translator: Dai Xu <daixu61@hotmail.com>, 2021\n"
19+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2022\n"
2020
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2121
"MIME-Version: 1.0\n"
2222
"Content-Type: text/plain; charset=UTF-8\n"
@@ -48,11 +48,11 @@ msgid ""
4848
"Return the magic string value used to recognize byte-compiled code files "
4949
"(:file:`.pyc` files). (This value may be different for each Python "
5050
"version.)"
51-
msgstr ""
51+
msgstr "返回用于识别字节编译代码文件 (:file:`.pyc` files) 的魔术字符串值。 (该值对于各个 Python 版本可能不同。)"
5252

5353
#: ../../library/imp.rst:28
5454
msgid "Use :attr:`importlib.util.MAGIC_NUMBER` instead."
55-
msgstr ""
55+
msgstr "改用 :attr:`importlib.util.MAGIC_NUMBER`。"
5656

5757
#: ../../library/imp.rst:34
5858
msgid ""

0 commit comments

Comments
 (0)