diff options
author | Duprat <yduprat@gmail.com> | 2024-11-07 09:10:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-07 08:10:57 +0000 |
commit | 75f7cf91ec5afc6091a0fd442a1f0435c19300b2 (patch) | |
tree | df031b829c314101ae9076f5f8f832f029d26fa2 /Lib/multiprocessing/synchronize.py | |
parent | d46d3f2ec783004f0927c9f5e6211a570360cf3b (diff) | |
download | cpython-75f7cf91ec5afc6091a0fd442a1f0435c19300b2.tar.gz cpython-75f7cf91ec5afc6091a0fd442a1f0435c19300b2.zip |
gh-125679: multiprocessing Lock and RLock - fix invalid representation string on MacOSX. (#125680)
Diffstat (limited to 'Lib/multiprocessing/synchronize.py')
-rw-r--r-- | Lib/multiprocessing/synchronize.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/multiprocessing/synchronize.py b/Lib/multiprocessing/synchronize.py index 1917a8bd51d..4f72373c951 100644 --- a/Lib/multiprocessing/synchronize.py +++ b/Lib/multiprocessing/synchronize.py @@ -173,7 +173,7 @@ class Lock(SemLock): name = process.current_process().name if threading.current_thread().name != 'MainThread': name += '|' + threading.current_thread().name - elif self._semlock._get_value() == 1: + elif not self._semlock._is_zero(): name = 'None' elif self._semlock._count() > 0: name = 'SomeOtherThread' @@ -199,7 +199,7 @@ class RLock(SemLock): if threading.current_thread().name != 'MainThread': name += '|' + threading.current_thread().name count = self._semlock._count() - elif self._semlock._get_value() == 1: + elif not self._semlock._is_zero(): name, count = 'None', 0 elif self._semlock._count() > 0: name, count = 'SomeOtherThread', 'nonzero' |