Skip to content

Commit

Permalink
Use old-style (3.5 ad 3.5) for asyncio.run
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno P. Kinoshita committed Apr 2, 2019
1 parent 6216eef commit a4a0769
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/cylc/network/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,13 @@ async def async_request(self, command, args=None, timeout=None):
raise ClientError(response['error'])

def serial_request(self, command, args=None, timeout=None):
return asyncio.run(
self.async_request(command, args, timeout))
# TODO: replace by asyncio.run when minimum req is py37
loop = asyncio.get_event_loop()
try:
return loop.run_until_complete(
self.async_request(command, args, timeout))
finally:
loop.close()

__call__ = serial_request

Expand Down

0 comments on commit a4a0769

Please sign in to comment.