subprocess2.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:node-gn 作者: Shouqun 项目源码 文件源码
def hack_subprocess():
  """subprocess functions may throw exceptions when used in multiple threads.

  See http://bugs.python.org/issue1731717 for more information.
  """
  global SUBPROCESS_CLEANUP_HACKED
  if not SUBPROCESS_CLEANUP_HACKED and threading.activeCount() != 1:
    # Only hack if there is ever multiple threads.
    # There is no point to leak with only one thread.
    subprocess._cleanup = lambda: None
    SUBPROCESS_CLEANUP_HACKED = True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号