Commit e0183b2
committed
Skip Py_Finalize to avoid threading module assertion errors
In embedded Python scenarios, Py_Finalize triggers threading._shutdown()
which can fail with assertion errors when executor threads have used
PyGILState_Ensure/Release. The threading module tracks these threads
internally and expects specific state during shutdown.
Since the process will clean up resources on exit anyway, we skip
Py_Finalize. This is a common pattern for embedded Python applications.1 parent dd4338d commit e0183b2
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
630 | 637 | | |
| 638 | + | |
631 | 639 | | |
632 | 640 | | |
633 | 641 | | |
| |||
0 commit comments