summaryrefslogtreecommitdiff
path: root/Lib/asyncio/locks.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2018-09-11 10:13:04 -0700
committerGitHub <noreply@github.com>2018-09-11 10:13:04 -0700
commit0baa72f4b2e7185298d09cf64c7b591efcd22af0 (patch)
tree20ee600a314eb8f65863edca9f3c90d88cfd9a02 /Lib/asyncio/locks.py
parent7c7605ff1133cf757cac428c483827f666c7c827 (diff)
downloadcpython-git-0baa72f4b2e7185298d09cf64c7b591efcd22af0.tar.gz
bpo-34622: Extract asyncio exceptions into a separate module (GH-9141)
Diffstat (limited to 'Lib/asyncio/locks.py')
-rw-r--r--Lib/asyncio/locks.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py
index 91f7a01de8..639bd11bd0 100644
--- a/Lib/asyncio/locks.py
+++ b/Lib/asyncio/locks.py
@@ -7,6 +7,7 @@ import warnings
from . import events
from . import futures
+from . import exceptions
from .coroutines import coroutine
@@ -192,7 +193,7 @@ class Lock(_ContextManagerMixin):
await fut
finally:
self._waiters.remove(fut)
- except futures.CancelledError:
+ except exceptions.CancelledError:
if not self._locked:
self._wake_up_first()
raise
@@ -363,11 +364,11 @@ class Condition(_ContextManagerMixin):
try:
await self.acquire()
break
- except futures.CancelledError:
+ except exceptions.CancelledError:
cancelled = True
if cancelled:
- raise futures.CancelledError
+ raise exceptions.CancelledError
async def wait_for(self, predicate):
"""Wait until a predicate becomes true.