Using the new coroutine syntax from pep-492.

This commit is contained in:
Andrew Hamilton 2016-10-16 12:10:22 +02:00
parent dedac08987
commit 71dc9df58c
2 changed files with 11 additions and 16 deletions

View file

@ -4,7 +4,6 @@
# Licensed under the Artistic License 2.0.
import ast
import asyncio
import contextlib
import dis
import enum
@ -642,8 +641,7 @@ class Result:
self.status = status
self.entry.appearance_cache = None
@asyncio.coroutine
def run(self, log, appearance_changed_event, runner):
async def run(self, log, appearance_changed_event, runner):
self.is_placeholder = False
tool_name = tool_name_colored(self.tool, self.path)
path = path_colored(self.path)
@ -654,7 +652,7 @@ class Result:
runner.pause()
appearance_changed_event.set()
start_time = time.time()
new_status = yield from runner.run_tool(self.path, self.tool)
new_status = await runner.run_tool(self.path, self.tool)
Result.result.fget.evict(self)
end_time = time.time()
self.set_status(new_status)