import inside of a Python thread

后端 未结 2 920
面向向阳花
面向向阳花 2020-12-17 15:06

I have some functions that interactively load python modules using __import__

I recently stumbled upon some article about an \"import lock\" in Python,

2条回答
  •  囚心锁ツ
    2020-12-17 15:49

    I could not find an answer in official documentation on this but it appears that in some versions of CPython 3.x, __import__ calls are not thread-safe, and can cause a deadlock. See: https://bugs.python.org/issue38884.

提交回复
热议问题