On 3/13/25 4:19 AM, Robin Dapp wrote:
Hi,

since updating to Fedora 41 I have been seeing ignored python exceptions
like the following when using 'git gcc-verify' = contrib/gcc_changelog/ git_check_commit.py.

Checking 90fcc1f4f1a5537e8d30628895a07cbb2e7e16ff: OK
Exception ignored in: <function Git.AutoInterrupt.__del__ at 0x7ff88dd01440>
Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/git/cmd.py", line 563, in __del__
 File "/usr/lib/python3.13/site-packages/git/cmd.py", line 544, in _terminate
  File "/usr/lib64/python3.13/subprocess.py", line 2227, in terminate
ImportError: sys.meta_path is None, Python is likely shutting down

This patch uses a simple fix found on the kernel mailing list [1].  All it does is wrap the repository access in a with clause and indent the remaining code. With that the output is as expected again:

Checking 90fcc1f4f1a5537e8d30628895a07cbb2e7e16ff: OK

git_update_version.py also uses an unwrapped "Repo" but as I'm not using that regularly I refrained from touching it.

Regards
Robin

[1] https://lkml.org/lkml/2025/2/25/1062

contrib/ChangeLog:

     * gcc-changelog/git_repository.py: Use with Repo(repo_path).
OK
jeff

Reply via email to