sys.exit()和thread.exit()都会引发SystemExit异常。因此,当sys.exit()在该线程内引发该异常时,它的作用与调用thread.exit()的作用相同,这就是为什么仅线程退出的原因。

 

slove:

调用os._exit(注意下划线)。使用之前,请确保它没有清理(如呼叫__del__或类似)

相关文章:

  • 2022-02-13
  • 2021-08-30
  • 2022-12-23
  • 2021-12-04
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-27
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案