aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorƁukasz Langa <lukasz@langa.pl>2022-08-04 15:51:38 +0200
committerGitHub <noreply@github.com>2022-08-04 15:51:38 +0200
commit0342c93a6b866118c894c4e1120fb4db316adebb (patch)
treee8b05345af99f1d74cec96bf555803714555857c /Lib/asyncio
parentd0d0154443cafb2f0a2cdfb6a1267d80cce8388e (diff)
downloadcpython-0342c93a6b866118c894c4e1120fb4db316adebb.tar.gz
cpython-0342c93a6b866118c894c4e1120fb4db316adebb.zip
gh-91323: Revert "Allow overriding a future compliance check in asyncio.Task (GH-32197)" (GH-95442)
This reverts commit d4bb38f82bf18b00db3129031ce4969b6f0caab9.
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/tasks.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index 3952b5f2a77..27fe58da151 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -252,10 +252,6 @@ class Task(futures._PyFuture): # Inherit Python Task implementation
self._num_cancels_requested -= 1
return self._num_cancels_requested
- def _check_future(self, future):
- """Return False if task and future loops are not compatible."""
- return futures._get_loop(future) is self._loop
-
def __step(self, exc=None):
if self.done():
raise exceptions.InvalidStateError(
@@ -296,7 +292,7 @@ class Task(futures._PyFuture): # Inherit Python Task implementation
blocking = getattr(result, '_asyncio_future_blocking', None)
if blocking is not None:
# Yielded Future must come from Future.__iter__().
- if not self._check_future(result):
+ if futures._get_loop(result) is not self._loop:
new_exc = RuntimeError(
f'Task {self!r} got Future '
f'{result!r} attached to a different loop')