Skip to content

Process to cleanly exit on KeyboardInterupt #1611

Answered by Byron
avylove asked this question in Q&A
Discussion options

You must be logged in to vote

That's a general issue with all python programs that do IO while being interrupted.
However, installing a signal handler in the parent application should be able to deal with this gracefully. The idea is to change the program state when receiving a signal so that the application can shut down gracefully. GitPython does not support interruptions though, so long-running clones will have to be waited upon. Common ways to deal with this is to call os.abort() or sys.exit to exit anyway, possibly without any other exceptions particularly in the case of os.abort().

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1610 on July 11, 2023 15:10.