mirror of
https://github.com/python/cpython.git
synced 2025-07-26 04:34:20 +00:00
bpo-45416: Fix use of asyncio.Condition() with explicit Lock objects (GH-28850)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 1a7892414e
)
Co-authored-by: Joongi Kim <joongi@lablup.com>
This commit is contained in:
parent
3c27013077
commit
164dddf5f8
3 changed files with 57 additions and 13 deletions
|
@ -230,8 +230,6 @@ class Condition(_ContextManagerMixin, mixins._LoopBoundMixin):
|
|||
super().__init__(loop=loop)
|
||||
if lock is None:
|
||||
lock = Lock()
|
||||
elif lock._loop is not self._get_loop():
|
||||
raise ValueError("loop argument must agree with lock")
|
||||
|
||||
self._lock = lock
|
||||
# Export the lock's locked(), acquire() and release() methods.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue