-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call Py_Finalize at exit using libc::atexit. #943
Conversation
Maybe this also removes the need for this hack: Lines 300 to 305 in 072be6c
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good idea to me. I wonder if this will also resolve #660
Quite possibly. Does |
Yes. |
Well, not if the panic is caught and the program keeps running. But it runs if the panic causes the program to exit, yes. |
Great, if you could please add a
But will take any other CHANGELOG message you think is good. |
This makes sure buffers are flushed, threads are joined, etc. when exiting the process.
Oh right, the changelog. Keep forgetting that file. Updated. |
Great, thanks 😄 I think regarding the hack - you're right that it probably isn't needed any more. But I think order of output still will change. Currently it's flush buffers then panic handler runs, if we remove the hack it'll be panic handler then flush buffers during finalize. So let's leave it there for now, but we might clean up later. |
Yeah. It's a shame that the CPython API doesn't have a |
Thank you! |
Thank you! |
This makes sure buffers are flushed, threads are joined, etc. when exiting the process.