Skip to content

Commit

Permalink
Use create_task() instead of ensure_future() for backward compatiblity
Browse files Browse the repository at this point in the history
Backward compatibility for Python 3.4.3
  • Loading branch information
chfoo committed Jun 5, 2016
1 parent 31acf9c commit e611513
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wpull/pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def tasks(self):
def process(self):
if self._state == PipelineState.stopped:
self._state = PipelineState.running
self._producer_task = asyncio.ensure_future(self._run_producer_wrapper())
self._producer_task = asyncio.get_event_loop().create_task(self._run_producer_wrapper())
self._unpaused_event.set()

while self._state == PipelineState.running:
Expand All @@ -202,7 +202,7 @@ def _process_one_worker(self):

while len(self._worker_tasks) < self._concurrency:
_logger.debug('Creating worker')
worker_task = asyncio.ensure_future(self._worker.process())
worker_task = asyncio.get_event_loop().create_task(self._worker.process())
self._worker_tasks.add(worker_task)

if self._worker_tasks:
Expand Down

0 comments on commit e611513

Please sign in to comment.