mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-02 21:44:51 +00:00
Add support for "async with" context manager
This commit is contained in:
parent
a329e56259
commit
a06885dd14
1 changed files with 6 additions and 0 deletions
|
|
@ -243,6 +243,12 @@ class Client(Methods, BaseClient):
|
|||
def __exit__(self, *args):
|
||||
self.stop()
|
||||
|
||||
async def __aenter__(self):
|
||||
return await self.start()
|
||||
|
||||
async def __aexit__(self, *args):
|
||||
await self.stop()
|
||||
|
||||
@property
|
||||
def proxy(self):
|
||||
return self._proxy
|
||||
|
|
|
|||
Loading…
Reference in a new issue