Skip to content

Commit

Permalink
return the result of the coroutine for the utility method: run
Browse files Browse the repository at this point in the history
Signed-off-by: devops117 <55235206+devops117@users.noreply.github.com>
  • Loading branch information
devops117 committed Jun 24, 2023
1 parent efac171 commit 2af36c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyrogram/methods/utilities/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ def run(
coroutine (``Coroutine``, *optional*):
Pass a coroutine to run it until it completes.
Returns:
Result of the coroutine, if provided.
Raises:
ConnectionError: In case you try to run an already started client.
Expand Down Expand Up @@ -74,7 +77,7 @@ async def main():
run = loop.run_until_complete

if coroutine is not None:
run(coroutine)
return run(coroutine)
else:
if inspect.iscoroutinefunction(self.start):
run(self.start())
Expand Down

0 comments on commit 2af36c2

Please sign in to comment.