99# Tony Tong <[email protected] >, 20181010# ww song <[email protected] >, 20181111# gashero liu <[email protected] >, 201912+ # Freesand Leo <[email protected] >, 20191213#
1314#, fuzzy
1415msgid ""
@@ -17,7 +18,7 @@ msgstr ""
1718"Report-Msgid-Bugs-To : \n "
1819"POT-Creation-Date : 2019-01-01 10:14+0900\n "
1920"PO-Revision-Date : 2017-02-16 17:42+0000\n "
20- "Last-Translator : gashero liu <harry.python@gmail .com>, 2019\n "
21+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2019\n "
2122"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2223"MIME-Version : 1.0\n "
2324"Content-Type : text/plain; charset=UTF-8\n "
@@ -205,8 +206,9 @@ msgid ""
205206"indicates the cause of the error and is converted to a Python string object "
206207"and stored as the \" associated value\" of the exception."
207208msgstr ""
208- "最常用的就是 :c:func:`PyErr_SetString` 。参数是异常对象和C字符串。异常对象一般由像 "
209- "PyExc_ZeroDivisionError 这样的对象来预定义。C字符串指明异常原因,并最终存储在异常的第一个参数里面。"
209+ "最常用的就是 :c:func:`PyErr_SetString`。 其参数是异常对象和 C 字符串。 异常对象一般是像 "
210+ ":c:data:`PyExc_ZeroDivisionError` 这样的预定义对象。 C 字符串指明异常原因,并被转换为一个 Python "
211+ "字符串对象存储为异常的“关联值”。"
210212
211213#: ../../extending/extending.rst:143
212214msgid ""
@@ -245,9 +247,10 @@ msgid ""
245247"executing Python code and tries to find an exception handler specified by "
246248"the Python programmer."
247249msgstr ""
248- "如果调用更下层函数时出错了,那么本函数返回NULL表示错误,并且整个调用栈中只要有一处调用 :c:func:`PyErr_*` 函数设置异常(通常用 "
249- "*NULL* 或 ``-1`` "
250- ")就可以。一般来说,首先发现错误的函数应该设置异常。一旦这个错误到达了Python解释器的主循环,则会中断当前执行代码并追究异常。"
250+ "当函数 *f* 调用另一个函数 *g* 时检测到后者出错了,*f* 自身将返回一个错误值 (通常为 *NULL* 或 ``-1``)。 它 *不应* "
251+ "调用某个 :c:func:`PyErr_\\ *` 函数 --- 这种函数已经由 *g* 调用过了。 然后 *f* 的调用者也应该返回一个错误提示 "
252+ "*它的* 调用者,同样 *不应* 调用 :c:func:`PyErr_\\ *`,依此类推 --- 错误的最详细原因已经由首先检测到它的函数报告了。 "
253+ "一旦这个错误到达了 Python 解释器的主循环,它将中断当前执行的 Python 代码并尝试找到由 Python 程序编写者所指定的异常句柄。"
251254
252255#: ../../extending/extending.rst:166
253256msgid ""
@@ -257,8 +260,8 @@ msgid ""
257260" can cause information about the cause of the error to be lost: most "
258261"operations can fail for a variety of reasons.)"
259262msgstr ""
260- "(有一种情况下,模块可能依靠其他 PyErr_*() "
261- "函数给出更加详细的错误信息,并且是正确的。 但是按照一般规则,这并不重要,很多操作都会因为种种原因而挂掉。) "
263+ "(在某些情况下,当模块确实能够通过调用其它 :c:func:` PyErr_\\ *` 函数给出更加详细的错误消息,并且在这些情况是可以这样做的。 "
264+ "但是按照一般规则,这是不必要的,并可能导致有关错误原因的信息丢失:大多数操作会由于种种原因而失败。) "
262265
263266#: ../../extending/extending.rst:172
264267msgid ""
@@ -269,8 +272,8 @@ msgid ""
269272"itself (possibly by trying something else, or pretending nothing went "
270273"wrong)."
271274msgstr ""
272- "想要忽略这些函数设置的异常,异常情况必须明确的使用 :c:func:`PyErr_Clear` "
273- "来清除。只有在C代码想要自己处理异常而不是传给解释器时才这么做。(可能想尝试其他的,或假装出错) 。"
275+ "想要忽略由一个失败的函数调用所设置的异常,异常条件必须通过调用 :c:func:`PyErr_Clear` 显式地被清除。 C 代码应当调用 "
276+ ":c:func:`PyErr_Clear` 的唯一情况是如果它不想将错误传给解释器而是想完全由自己来处理它(可能是尝试其他方法,或是假装没有出错) 。"
274277
275278#: ../../extending/extending.rst:178
276279msgid ""
@@ -289,15 +292,17 @@ msgid ""
289292"positive value or zero for success and ``-1`` for failure, like Unix system "
290293"calls."
291294msgstr ""
292- "还要注意的是 :c:func:`PyArg_ParseTuple` "
293- "系列函数的异常,返回一个整数状态码是有效的,0是成功,-1是失败,有如Unix系统调用 。"
295+ "还要注意的是,除了 :c:func:`PyArg_ParseTuple` 等重要的例外,返回整数状态码的函数通常都是返回正值或零来表示成功,而以 "
296+ "``-1`` 表示失败,如同 Unix 系统调用一样 。"
294297
295298#: ../../extending/extending.rst:188
296299msgid ""
297300"Finally, be careful to clean up garbage (by making :c:func:`Py_XDECREF` or "
298301":c:func:`Py_DECREF` calls for objects you have already created) when you "
299302"return an error indicator!"
300- msgstr "最后,小心垃圾情理,也就是 :c:func:`Py_XDECREF` 和 :c:func:`Py_DECREF` 的调用,会返回的异常。"
303+ msgstr ""
304+ "最后,当你返回一个错误指示器时要注意清理垃圾(通过为你已经创建的对象执行 :c:func:`Py_XDECREF` 或 "
305+ ":c:func:`Py_DECREF` 调用)!"
301306
302307#: ../../extending/extending.rst:192
303308msgid ""
@@ -534,6 +539,10 @@ msgid ""
534539"distribution as :file:`Modules/xxmodule.c`. This file may be used as a "
535540"template or simply read as an example."
536541msgstr ""
542+ "更多关于模块的现实的例子包含在Python源码包的 :file:`Modules/xxmodule.c` "
543+ "中。这些文件可以用作你的代码模板,或者学习。脚本 modulator.py "
544+ "包含在源码发行版或Windows安装中,提供了一个简单的GUI,用来声明需要实现的函数和对象,并且可以生成供填入的模板。脚本在 "
545+ "Tools/modulator/ 目录。查看README以了解用法。"
537546
538547#: ../../extending/extending.rst:421
539548msgid ""
@@ -545,7 +554,7 @@ msgstr ""
545554
546555#: ../../extending/extending.rst:430
547556msgid "Compilation and Linkage"
548- msgstr ""
557+ msgstr "编译和链接 "
549558
550559#: ../../extending/extending.rst:432
551560msgid ""
0 commit comments