Skip to content

fix: guard AutoInterrupt terminate during interpreter shutdown#2105

Open
lweyrich1 wants to merge 1 commit intogitpython-developers:mainfrom
lweyrich1:fix-autointerrupt-shutdown-guard
Open

fix: guard AutoInterrupt terminate during interpreter shutdown#2105
lweyrich1 wants to merge 1 commit intogitpython-developers:mainfrom
lweyrich1:fix-autointerrupt-shutdown-guard

Conversation

@lweyrich1
Copy link

Fixes #2102

On Windows during interpreter shutdown, process objects can be partially torn down and terminate() may raise AttributeError (e.g. missing TerminateProcess).

This PR treats that similarly to the existing OSError handling in _AutoInterrupt._terminate() and adds a regression test covering the AttributeError case.

Tests: pytest -q test/test_autointerrupt.py

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the fix, looks good to me!

I will merge once CI is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'NoneType' object has no attribute 'TerminateProcess' when accessing tree during iter_commits

2 participants