Skip to content

Commit 79911bc

Browse files
authored
Update __init__.py
1 parent 529b9a7 commit 79911bc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

qasync/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ def wrapper(*args, **kwargs):
814814

815815
@contextlib.contextmanager
816816
def _use_qeventloop():
817-
app = QApplication.instance() or QApplication([])
817+
app = QApplication.instance() or QApplication([sys.argv])
818818
loop = QEventLoop(app)
819819
old_loop = asyncio.get_event_loop()
820820
asyncio.set_event_loop(loop)
@@ -825,10 +825,10 @@ def _use_qeventloop():
825825
asyncio.set_event_loop(old_loop)
826826

827827

828-
def run(main, *args, **kwargs):
828+
def run(future):
829829
"""
830-
Run the given coroutine using a QEventLoop without setting a global policy.
830+
Run the given coroutine using a QEventLoop.
831831
"""
832832
with _use_qeventloop() as loop:
833-
return loop.run_until_complete(main(*args, **kwargs))
833+
return loop.run_until_complete(future)
834834

0 commit comments

Comments
 (0)