@@ -16,7 +16,7 @@ msgid ""
1616msgstr ""
1717"Project-Id-Version : Python 3.8\n "
1818"Report-Msgid-Bugs-To : \n "
19- "POT-Creation-Date : 2020-01-01 12:19 +0000\n "
19+ "POT-Creation-Date : 2020-02-07 12:39 +0000\n "
2020"PO-Revision-Date : 2017-02-16 23:40+0000\n "
2121"
Last-Translator :
Freesand Leo <[email protected] >, 2020\n "
2222"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -340,27 +340,22 @@ msgstr ":keyword:`try` 语句有另一个可选子句,用于定义必须在所
340340
341341#: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:344
342342msgid ""
343- "If a :keyword:`finally` clause is present, the :keyword:`finally` clause "
343+ "If a :keyword:`finally` clause is present, the :keyword:`! finally` clause "
344344"will execute as the last task before the :keyword:`try` statement completes."
345- " The :keyword:`finally` clause runs whether or not the :keyword:`try` "
345+ " The :keyword:`! finally` clause runs whether or not the :keyword:`! try` "
346346"statement produces an exception. The following points discuss more complex "
347347"cases when an exception occurs:"
348348msgstr ""
349- "如果存在 :keyword:`finally` 子句,则 :keyword:`finally` 子句将作为 :keyword:`try` "
350- "语句结束前的最后一项任务被执行。 :keyword:`finally` 子句不论 :keyword:`try` 语句是否产生了异常都会被执行。 "
351- "以下几点讨论了当异常发生时一些更复杂的情况:"
352349
353- #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:346
350+ #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:350
354351msgid ""
355352"If an exception occurs during execution of the :keyword:`!try` clause, the "
356353"exception may be handled by an :keyword:`except` clause. If the exception is"
357- " not handled by an :keyword:`except` clause, the exception is re-raised "
354+ " not handled by an :keyword:`! except` clause, the exception is re-raised "
358355"after the :keyword:`!finally` clause has been executed."
359356msgstr ""
360- "如果在执行 :keyword:`!try` 子句期间发生了异常,该异常可由一个 :keyword:`except` 子句进行处理。 如果异常没有被 "
361- ":keyword:`except` 子句所处理,则该异常会在 :keyword:`!finally` 子句执行之后被重新引发。"
362357
363- #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:348
358+ #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:356
364359msgid ""
365360"An exception could occur during execution of an :keyword:`!except` or "
366361":keyword:`!else` clause. Again, the exception is re-raised after the "
@@ -369,35 +364,31 @@ msgstr ""
369364"异常也可能在 :keyword:`!except` 或 :keyword:`!else` 子句执行期间发生。 同样地,该异常会在 "
370365":keyword:`!finally` 子句执行之后被重新引发。"
371366
372- #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:350
367+ #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:360
373368msgid ""
374369"If the :keyword:`!try` statement reaches a :keyword:`break`, "
375- ":keyword:`continue` or :keyword:`return` statement, the :keyword:`finally` "
376- "clause will execute just prior to the :keyword:`break`, :keyword:`continue` "
377- "or :keyword:`return` statement's execution."
370+ ":keyword:`continue` or :keyword:`return` statement, the :keyword:`! finally` "
371+ "clause will execute just prior to the :keyword:`! break`, "
372+ ":keyword:`!continue` or :keyword:`! return` statement's execution."
378373msgstr ""
379- "如果在执行 :keyword:`!try` 语句时遇到一个 :keyword:`break`, :keyword:`continue` 或 "
380- ":keyword:`return` 语句,则 :keyword:`finally` 子句将在执行 :keyword:`break`, "
381- ":keyword:`continue` 或 :keyword:`return` 语句之前被执行。"
382374
383- #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:352
375+ #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:366
384376msgid ""
385- "If a :keyword:`finally` clause includes a :keyword:`return` statement, the "
386- ":keyword:`finally` clause's :keyword:`return` statement will execute before,"
387- " and instead of, the :keyword:`return` statement in a :keyword:`try` clause."
377+ "If a :keyword:`!finally` clause includes a :keyword:`!return` statement, the"
378+ " returned value will be the one from the :keyword:`!finally` clause's "
379+ ":keyword:`!return` statement, not the value from the :keyword:`!try` "
380+ "clause's :keyword:`!return` statement."
388381msgstr ""
389- "如果 :keyword:`finally` 子句中包含一个 :keyword:`return` 语句,则 :keyword:`finally` 子句的 "
390- ":keyword:`return` 语句将在执行 :keyword:`try` 子句的 :keyword:`return` 语句之前取代后者被执行。"
391382
392- #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:354
383+ #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:372
393384msgid "For example::"
394385msgstr "例如 ::"
395386
396- #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:365
387+ #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:383
397388msgid "A more complicated example::"
398389msgstr "一个更为复杂的例子::"
399390
400- #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:390
391+ #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:408
401392msgid ""
402393"As you can see, the :keyword:`finally` clause is executed in any event. The"
403394" :exc:`TypeError` raised by dividing two strings is not handled by the "
@@ -407,18 +398,18 @@ msgstr ""
407398"正如你所看到的,:keyword:`finally` 子句在任何情况下都会被执行。 两个字符串相除所引发的 :exc:`TypeError` 不会由 "
408399":keyword:`except` 子句处理,因此会在 :keyword:`!finally` 子句执行后被重新引发。"
409400
410- #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:395
401+ #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:413
411402msgid ""
412403"In real world applications, the :keyword:`finally` clause is useful for "
413404"releasing external resources (such as files or network connections), "
414405"regardless of whether the use of the resource was successful."
415406msgstr "在实际应用程序中,:keyword:`finally` 子句对于释放外部资源(例如文件或者网络连接)非常有用,无论是否成功使用资源。"
416407
417- #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:403
408+ #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:421
418409msgid "Predefined Clean-up Actions"
419410msgstr "预定义的清理操作"
420411
421- #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:405
412+ #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:423
422413msgid ""
423414"Some objects define standard clean-up actions to be undertaken when the "
424415"object is no longer needed, regardless of whether or not the operation using"
@@ -427,7 +418,7 @@ msgid ""
427418msgstr ""
428419"某些对象定义了在不再需要该对象时要执行的标准清理操作,无论使用该对象的操作是成功还是失败。请查看下面的示例,它尝试打开一个文件并把其内容打印到屏幕上。::"
429420
430- #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:413
421+ #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:431
431422msgid ""
432423"The problem with this code is that it leaves the file open for an "
433424"indeterminate amount of time after this part of the code has finished "
@@ -439,7 +430,7 @@ msgstr ""
439430"这个代码的问题在于,它在这部分代码执行完后,会使文件在一段不确定的时间内处于打开状态。这在简单脚本中不是问题,但对于较大的应用程序来说可能是个问题。 "
440431":keyword:`with` 语句允许像文件这样的对象能够以一种确保它们得到及时和正确的清理的方式使用。::"
441432
442- #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:423
433+ #: /home/travis/build/python/cpython-doc-catalog/Doc/tutorial/errors.rst:441
443434msgid ""
444435"After the statement is executed, the file *f* is always closed, even if a "
445436"problem was encountered while processing the lines. Objects which, like "
0 commit comments