changeset: 96330:adf72cffceb7 branch: 3.5 parent: 96324:d7e392c5c53a parent: 96329:09327f653ec5 user: Yury Selivanov date: Thu May 28 10:52:46 2015 -0400 description: asyncio: Drop some useless code from tasks.py. See also issue 24017. diff -r d7e392c5c53a -r adf72cffceb7 Lib/asyncio/tasks.py --- a/Lib/asyncio/tasks.py Wed May 27 21:59:03 2015 -0400 +++ b/Lib/asyncio/tasks.py Thu May 28 10:52:46 2015 -0400 @@ -74,10 +74,7 @@ super().__init__(loop=loop) if self._source_traceback: del self._source_traceback[-1] - if coro.__class__ is types.GeneratorType: - self._coro = coro - else: - self._coro = iter(coro) # Use the iterator just in case. + self._coro = coro self._fut_waiter = None self._must_cancel = False self._loop.call_soon(self._step) @@ -237,10 +234,8 @@ try: if exc is not None: result = coro.throw(exc) - elif value is not None: + else: result = coro.send(value) - else: - result = coro.send(None) except StopIteration as exc: self.set_result(exc.value) except futures.CancelledError as exc: