kopia lustrzana https://github.com/micropython/micropython-lib
aiorepl: Handle stream shutdown.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>pull/1039/head v1.26.0
rodzic
b95ca2491a
commit
34c4ee1647
|
@ -114,6 +114,8 @@ async def task(g=None, prompt="--> "):
|
||||||
curs = 0 # cursor offset from end of cmd buffer
|
curs = 0 # cursor offset from end of cmd buffer
|
||||||
while True:
|
while True:
|
||||||
b = await s.read(1)
|
b = await s.read(1)
|
||||||
|
if not b: # Handle EOF/empty read
|
||||||
|
break
|
||||||
pc = c # save previous character
|
pc = c # save previous character
|
||||||
c = ord(b)
|
c = ord(b)
|
||||||
pt = t # save previous time
|
pt = t # save previous time
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
metadata(
|
metadata(
|
||||||
version="0.2.1",
|
version="0.2.2",
|
||||||
description="Provides an asynchronous REPL that can run concurrently with an asyncio, also allowing await expressions.",
|
description="Provides an asynchronous REPL that can run concurrently with an asyncio, also allowing await expressions.",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue