]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-116738: Use PyMutex for bz2 module (gh-140555)
authorAlper <alperyoney@fb.com>
Mon, 27 Oct 2025 13:52:30 +0000 (06:52 -0700)
committerGitHub <noreply@github.com>
Mon, 27 Oct 2025 13:52:30 +0000 (09:52 -0400)
commit9479a62a51e6fbcb3372f5ac07b3ab861e7d17e3
treeb8b62602a1e31f01f6b30b9d38664c6096d159a8
parente8b5cb8f33caeb779c6e2a59776ea62bd8c684d2
gh-116738: Use PyMutex for bz2 module (gh-140555)

The methods are already wrapped with a lock, which makes them thread-safe in
free-threaded build. This replaces `PyThread_acquire_lock` with `PyMutex` and
removes some macros and allocation handling code.

Also add a test for free-threading to ensure we aren't getting data races and
that the locking is working.
Lib/test/test_free_threading/test_bz2.py [new file with mode: 0644]
Modules/_bz2module.c