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:
Miss Islington (bot) 2021-10-10 09:25:14 -07:00 committed by GitHub
parent 3c27013077
commit 164dddf5f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 13 deletions

View file

@ -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.