Skip to content

Commit 9e2a2df

Browse files
committed
WIP Add aenter and aexit methods to base class [skip ci]
It also replaces the ABC inheritance with the AbstarctAsyncContextManager class. That class itself is the base abstract interface for asynchronous context manager. TODO: Try and test it
1 parent 68a3b81 commit 9e2a2df

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

aries_cloudcontroller/aries_controller_base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from aiohttp import (
22
ClientSession,
33
)
4-
from abc import ABC
4+
from contextlib import AbstractAsyncContextManager
55
from dataclasses import dataclass
66
from pubsub import pub
77

@@ -27,7 +27,7 @@
2727

2828

2929
@dataclass
30-
class AriesAgentControllerBase(ABC):
30+
class AriesAgentControllerBase(AbstractAsyncContextManager):
3131
"""The Aries Agent Controller class
3232
3333
This class allows you to interact with Aries by exposing the aca-py API.
@@ -97,7 +97,7 @@ def __post_init__(self):
9797

9898
self.revocations = RevocationController(self.admin_url, self.client_session)
9999

100-
def __enter__(self):
100+
async def __aenter__(self):
101101
return self
102102

103103
async def __aexit__(self, exc_type, exc_value, exc_traceback):

0 commit comments

Comments
 (0)