◐ Shell
clean mode source ↗

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 AttributeError from proc.terminate() similarly to existing OSError handling in _AutoInterrupt._terminate().
  • Add a regression test that simulates terminate() raising AttributeError and asserts _terminate() does not raise and clears proc.

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().