diff --git a/github/client.py b/github/client.py index bbd7032..d5ca29d 100644 --- a/github/client.py +++ b/github/client.py @@ -104,13 +104,10 @@ class GHClient: async def __aexit__(self, *args: Any, **kwargs: Any) -> None: try: session = self.http.session - await self.session.close() + await session.close() except Exception as exc: raise Exception('HTTP Session doesn\'t exist') from exc - if session := getattr(self.http, 'session', None): - await session.close() - def __repr__(self) -> str: return f'<{self.__class__.__name__} has_auth={bool(self._auth)}>'