summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/tasks.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-12-11 16:34:11 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-12-11 16:34:11 (GMT)
commitd3ded40a53df40c5dd9c1fd05c886bfe91df4aee (patch)
treec1a8a40091c0dbde19fc418b19689f10282fe0ad /Lib/asyncio/tasks.py
parent7888e6702776c0e619fbf10857534fc18b0d1a1a (diff)
parent0ac3a0cd7932079724aaabbb0a078e1c17129068 (diff)
downloadcpython-d3ded40a53df40c5dd9c1fd05c886bfe91df4aee.zip
cpython-d3ded40a53df40c5dd9c1fd05c886bfe91df4aee.tar.gz
cpython-d3ded40a53df40c5dd9c1fd05c886bfe91df4aee.tar.bz2
Merge 3.4
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r--Lib/asyncio/tasks.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index e6389d8..a2ab881 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -251,7 +251,13 @@ class Task(futures.Future):
else:
if isinstance(result, futures.Future):
# Yielded Future must come from Future.__iter__().
- if result._blocking:
+ if result._loop is not self._loop:
+ self._loop.call_soon(
+ self._step,
+ RuntimeError(
+ 'Task {!r} got Future {!r} attached to a '
+ 'different loop'.format(self, result)))
+ elif result._blocking:
result._blocking = False
result.add_done_callback(self._wakeup)
self._fut_waiter = result