Skip to content

Commit e4ca84c

Browse files
committed
Fix 146: Autenticated client was overriding the manager and it was causing issue
1 parent d2f56b0 commit e4ca84c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/aleph/sdk/client/authenticated_http.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ def __init__(
8989
)
9090
self.account = account
9191

92-
async def __aenter__(self) -> "AuthenticatedAlephHttpClient":
93-
return self
94-
9592
async def ipfs_push(self, content: Mapping) -> str:
9693
"""
9794
Push arbitrary content as JSON to the IPFS service.

src/aleph/sdk/client/http.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ async def __aenter__(self) -> "AlephHttpClient":
9595
return self
9696

9797
async def __aexit__(self, exc_type, exc_val, exc_tb):
98-
await self.http_session.close()
98+
# Avoid cascade in error handling
99+
if self._http_session is not None:
100+
await self._http_session.close()
99101

100102
async def fetch_aggregate(self, address: str, key: str) -> Dict[str, Dict]:
101103
params: Dict[str, Any] = {"keys": key}

0 commit comments

Comments
 (0)