In asyncio.locks.Lock.acquire(): Avoid deadlock when a cancelled future is in self._waiters.
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py
index 741aaf2..deefc93 100644
--- a/Lib/asyncio/locks.py
+++ b/Lib/asyncio/locks.py
@@ -166,7 +166,7 @@
         This method blocks until the lock is unlocked, then sets it to
         locked and returns True.
         """
-        if not self._waiters and not self._locked:
+        if not self._locked and all(w.cancelled() for w in self._waiters):
             self._locked = True
             return True