Convert more files to async/await syntax (#14142)

* Move more files to async/await syntax

* Attempt Work around pylint bug

Using lazytox :P
This commit is contained in:
Otto Winter authored and Paulus Schoutsen committed 2018-04-28 19:26:20 -04:00
1 parent a0b14c2913
commit a4bf421044
27 files changed
+229 -327

No files matched your search

+3 -4
View File
@@ -49,17 +49,16 @@ class AsyncHandler(object):
"""Wrap close to handler."""
self.emit(None)
@asyncio.coroutine
def async_close(self, blocking=False):
async def async_close(self, blocking=False):
"""Close the handler.
When blocking=True, will wait till closed.
"""
yield from self._queue.put(None)
await self._queue.put(None)
if blocking:
while self._thread.is_alive():
yield from asyncio.sleep(0, loop=self.loop)
await asyncio.sleep(0, loop=self.loop)
def emit(self, record):
"""Process a record."""