mirror of
https://github.com/RGBCube/GitHubWrapper
synced 2025-05-17 14:35:09 +00:00
Fixed walrus, for real
This commit is contained in:
parent
04bdadc995
commit
efabb44b54
1 changed files with 1 additions and 4 deletions
|
@ -104,13 +104,10 @@ class GHClient:
|
||||||
async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
|
async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
|
||||||
try:
|
try:
|
||||||
session = self.http.session
|
session = self.http.session
|
||||||
await self.session.close()
|
await session.close()
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
raise Exception('HTTP Session doesn\'t exist') from exc
|
raise Exception('HTTP Session doesn\'t exist') from exc
|
||||||
|
|
||||||
if session := getattr(self.http, 'session', None):
|
|
||||||
await session.close()
|
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return f'<{self.__class__.__name__} has_auth={bool(self._auth)}>'
|
return f'<{self.__class__.__name__} has_auth={bool(self._auth)}>'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue