Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
dkang-quora committed Dec 2, 2023
1 parent 74e7d92 commit b926cc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions asynq/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,15 @@ async def asyncio_call(fn, *args, **kwargs):
"""
if is_pure_async_fn(fn):
return (await fn.asyncio(*args, **kwargs))
return await fn.asyncio(*args, **kwargs)
elif hasattr(fn, "asynq"):
return (await fn.asyncio(*args, **kwargs))
return await fn.asyncio(*args, **kwargs)
elif hasattr(fn, "async"):
return (await getattr(fn, "async")(*args, **kwargs))
return await getattr(fn, "async")(*args, **kwargs)
else:
return fn(*args, **kwargs)


@async_proxy(asyncio_fn=asyncio_call)
def async_call(fn, *args, **kwargs):
"""Use this if you are not sure if fn is async or not.
Expand Down
2 changes: 1 addition & 1 deletion asynq/tests/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def f3(arg, kw=1):

@asynq()
def g0(f, *args, **kwargs):
d = (yield async_call.asynq(f, *args, **kwargs))
d = yield async_call.asynq(f, *args, **kwargs)
return d

for f in [f1, f2, f3]:
Expand Down

0 comments on commit b926cc3

Please sign in to comment.