Skip to content

Commit 35ffc98

Browse files
committed
pythongh-121661: Add test
1 parent f3aa6f6 commit 35ffc98

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Lib/test/test_repl.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,16 @@ def bar(x):
198198
def test_asyncio_repl_no_tty_fails(self):
199199
assert assert_python_failure("-m", "asyncio")
200200

201+
def test_asyncio_repl_non_blocking_does_not_fail(self):
202+
import os, sys
203+
from _pyrepl.unix_console import UnixConsole
204+
205+
os.set_blocking(sys.stdin.fileno(), False)
206+
console = UnixConsole()
207+
208+
# get_event would throw a BlockingIOError before fixing gh-121662 in this scenario
209+
assert console.get_event(block=False) is None
210+
201211

202212
class TestInteractiveModeSyntaxErrors(unittest.TestCase):
203213

0 commit comments

Comments
 (0)