This fixes issues with the kill method in the trio server:
async def kill(self):
"""Kill the Lean process."""
await self.process.kill()
self.process.kill() is not await-able:
TypeError: object NoneType can't be used in 'await' expression
So I removed that await. Now there is no reason for it to be async, so I removed that as well.
Last, I added server.kill() to the trio example. I think it is a good habit to kill processes after you start them. Here it doesn't matter since you are exiting the application (and exiting trio which I also imagine would kill it), however, it is good to have. Also it acts as a sort of (weak) test that the bug is fixed.
This fixes issues with the
kill
method in the trio server:self.process.kill()
is notawait
-able:So I removed that
await
. Now there is no reason for it to beasync
, so I removed that as well.Last, I added
server.kill()
to the trio example. I think it is a good habit to kill processes after you start them. Here it doesn't matter since you are exiting the application (and exiting trio which I also imagine would kill it), however, it is good to have. Also it acts as a sort of (weak) test that the bug is fixed.