From 34c4ee1647ac4b177ae40adf0ec514660e433dc0 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Tue, 17 Jun 2025 15:04:39 +1000 Subject: [PATCH] aiorepl: Handle stream shutdown. Signed-off-by: Andrew Leech --- micropython/aiorepl/aiorepl.py | 2 ++ micropython/aiorepl/manifest.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/micropython/aiorepl/aiorepl.py b/micropython/aiorepl/aiorepl.py index a640efcd1..fbe513b7c 100644 --- a/micropython/aiorepl/aiorepl.py +++ b/micropython/aiorepl/aiorepl.py @@ -114,6 +114,8 @@ async def task(g=None, prompt="--> "): curs = 0 # cursor offset from end of cmd buffer while True: b = await s.read(1) + if not b: # Handle EOF/empty read + break pc = c # save previous character c = ord(b) pt = t # save previous time diff --git a/micropython/aiorepl/manifest.py b/micropython/aiorepl/manifest.py index ca2fa1513..83802e1c0 100644 --- a/micropython/aiorepl/manifest.py +++ b/micropython/aiorepl/manifest.py @@ -1,5 +1,5 @@ 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.", )