Commit eb50e07 1 parent 6864f28 commit eb50e07 Copy full SHA for eb50e07
File tree 1 file changed +3
-1
lines changed
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -2118,13 +2118,15 @@ def attrtype(input_text: str):
2118
2118
async def console (ctx : Context ):
2119
2119
import sys
2120
2120
queue = asyncio .Queue ()
2121
- Utils .stream_input (sys .stdin , queue )
2121
+ worker = Utils .stream_input (sys .stdin , queue )
2122
2122
while not ctx .exit_event .is_set ():
2123
2123
try :
2124
2124
# I don't get why this while loop is needed. Works fine without it on clients,
2125
2125
# but the queue.get() for server never fulfills if the queue is empty when entering the await.
2126
2126
while queue .qsize () == 0 :
2127
2127
await asyncio .sleep (0.05 )
2128
+ if not worker .is_alive ():
2129
+ return
2128
2130
input_text = await queue .get ()
2129
2131
queue .task_done ()
2130
2132
ctx .commandprocessor (input_text )
You can’t perform that action at this time.
0 commit comments