fix: guard AutoInterrupt terminate during interpreter shutdown by lweyrich1 · Pull Request #2105 · gitpython-developers/GitPython
Pull request overview
Fixes a Windows interpreter-shutdown edge case where Git.AutoInterrupt._terminate() can raise AttributeError from subprocess.Popen.terminate() due to partially torn-down stdlib internals, preventing noisy “Exception ignored in: del” messages.
Changes:
- Treat
AttributeErrorfromproc.terminate()similarly to existingOSErrorhandling in_AutoInterrupt._terminate(). - Add a regression test that simulates
terminate()raisingAttributeErrorand asserts_terminate()does not raise and clearsproc.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
git/cmd.py |
Extends _AutoInterrupt._terminate() exception handling to include AttributeError during termination. |
test/test_autointerrupt.py |
Adds a focused regression test for AttributeError raised from terminate(). |