Skip to content

Commit

Permalink
tweak action
Browse files Browse the repository at this point in the history
  • Loading branch information
emrgnt-cmplxty committed Oct 10, 2024
1 parent f390b15 commit f457f03
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions py/sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,17 @@ def _sync_generator(self, async_gen: AsyncGenerator) -> Generator:

def __getattr__(self, name):
async_attr = getattr(self.async_client, name)
# if callable(async_attr):
if callable(async_attr):

# def sync_wrapper(*args, **kwargs):
# result = asyncio.get_event_loop().run_until_complete(
# async_attr(*args, **kwargs)
# )
# if isinstance(result, AsyncGenerator):
# return self._sync_generator(result)
# return result
def sync_wrapper(*args, **kwargs):
result = asyncio.get_event_loop().run_until_complete(
async_attr(*args, **kwargs)
)
if isinstance(result, AsyncGenerator):
return self._sync_generator(result)
return result

# return sync_wrapper
return sync_wrapper
return async_attr

def __dir__(self):
Expand Down

0 comments on commit f457f03

Please sign in to comment.