Skip to content

Commit f97eceb

Browse files
committed
add the close method
1 parent 0c4576f commit f97eceb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mystbin/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ class Client:
4141
def __init__(self, *, token: Optional[str] = None, session: Optional[aiohttp.ClientSession] = None) -> None:
4242
self.http: HTTPClient = HTTPClient(token=token, session=session)
4343

44+
async def close(self) -> None:
45+
"""|coro|
46+
47+
Closes the internal HTTP session and this client.
48+
"""
49+
if self.http.__session:
50+
await self.http.__session.close()
51+
4452
async def create_paste(
4553
self,
4654
*,

0 commit comments

Comments
 (0)