@@ -404,7 +404,7 @@ msgstr "返回与此 Python 版本魔数相匹配的 :pep:`3147` 魔术标签字
404404#: ../../library/imp.rst:248
405405msgid ""
406406"Use :attr:`sys.implementation.cache_tag` directly starting in Python 3.3."
407- msgstr ""
407+ msgstr "从 Python 3.3 开始直接使用 :attr:`sys.implementation.cache_tag`。 "
408408
409409#: ../../library/imp.rst:253
410410msgid ""
@@ -413,12 +413,14 @@ msgid ""
413413"detail which may vary from release to release. However, Python ensures that"
414414" circular imports work without any deadlocks."
415415msgstr ""
416+ "以下函数可以帮助与导入系统的内部锁定机制进行交互。 导入的锁定语义是一个可能在不同发布版之间发生改变的实现细节。 但是,Python "
417+ "会确保循环导入操作不会出现任何死锁。"
416418
417419#: ../../library/imp.rst:261
418420msgid ""
419421"Return ``True`` if the global import lock is currently held, else ``False``."
420422" On platforms without threads, always return ``False``."
421- msgstr ""
423+ msgstr "如果当前持有全局导入锁则返回 ``True``,否则返回 ``False``。 在没有线程的系统平台上,将总是返回 ``False``。 "
422424
423425#: ../../library/imp.rst:264
424426msgid ""
@@ -430,44 +432,47 @@ msgid ""
430432"circular imports, which by construction have to expose an incomplete module "
431433"object at some point."
432434msgstr ""
435+ "在有线程的平台上,执行导入的线程首先会持有一个全局导入锁,然后为导入其余部分设置模块专属锁。 "
436+ "这将阻止其他线程导入相同的模块直到原始导入完成,防止其他线程看到由原始线程构建的不完整的模块对象。 "
437+ "循环导入是个例外情况,它在构造上就必须在某一时刻暴露不完整的模块对象。"
433438
434439#: ../../library/imp.rst:272 ../../library/imp.rst:292
435440#: ../../library/imp.rst:305
436441msgid ""
437442"The locking scheme has changed to per-module locks for the most part. A "
438443"global import lock is kept for some critical tasks, such as initializing the"
439444" per-module locks."
440- msgstr ""
445+ msgstr "锁定方案在大多数情况下都已改为按模块锁定。 对于某些关键任务会保留一个全局导入锁,比如初始化每个模块的锁。 "
441446
442447#: ../../library/imp.rst:282
443448msgid ""
444449"Acquire the interpreter's global import lock for the current thread. This "
445450"lock should be used by import hooks to ensure thread-safety when importing "
446451"modules."
447- msgstr ""
452+ msgstr "为当前线程获取解释器的全局导入锁。 这个锁应当由导入钩子来使用以确保导入模块时的线程安全。 "
448453
449454#: ../../library/imp.rst:286
450455msgid ""
451456"Once a thread has acquired the import lock, the same thread may acquire it "
452457"again without blocking; the thread must release it once for each time it has"
453458" acquired it."
454- msgstr ""
459+ msgstr "一旦某个线程获取了导入锁,同一个线程可以再次获取它而不会阻塞;该线程每次获得它都必须再释放它一次。 "
455460
456461#: ../../library/imp.rst:290
457462msgid "On platforms without threads, this function does nothing."
458- msgstr ""
463+ msgstr "在没有线程的平台上,此函数将不做任何操作。 "
459464
460465#: ../../library/imp.rst:302
461466msgid ""
462467"Release the interpreter's global import lock. On platforms without threads, "
463468"this function does nothing."
464- msgstr ""
469+ msgstr "释放解释器的全局导入锁。 在没有线程的平台上,此函数将不做任何操作。 "
465470
466471#: ../../library/imp.rst:313
467472msgid ""
468473"The following constants with integer values, defined in this module, are "
469474"used to indicate the search result of :func:`find_module`."
470- msgstr ""
475+ msgstr "以下是在本模块中定义的具有整数值的常量,用来表示 :func:`find_module` 的搜索结果。 "
471476
472477#: ../../library/imp.rst:319
473478msgid "The module was found as a source file."
0 commit comments