Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
主进程里 login 的优先顺序忘了改了,之前先开的 console 线程导致输入验证码的 input 抢不到 stdin。
event_loop 的运行方式改成任一协程 Exception 就结束,方便获取错误信息。
  • Loading branch information
yawwwwwn committed Aug 20, 2019
1 parent f08bd5d commit 39a651c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@
task4 = connect()
task5 = PKLottery()

console_thread = threading.Thread(target=biliconsole.controler)

console_thread.start()

tasks1 = [
login().login_new()
]
loop.run_until_complete(asyncio.wait(tasks1))

console_thread = threading.Thread(target=biliconsole.controler)
console_thread.start()

tasks = [
task.run(),
task1.run(),
Expand All @@ -48,7 +47,7 @@
task5.run()
]

loop.run_until_complete(asyncio.wait(tasks))
console_thread.join()

loop.run_until_complete(asyncio.wait(tasks, return_when=asyncio.FIRST_EXCEPTION))
loop.close()

console_thread.join()

0 comments on commit 39a651c

Please sign in to comment.