From dd8db974d7c9e5bf54da1ca1383af674d6b7b27e Mon Sep 17 00:00:00 2001 From: Yu-Ming Chang Date: Thu, 14 May 2020 16:49:13 +0800 Subject: [PATCH] unix/main: Enter REPL when inspect active, even with stdin redirected. This is how CPython behaves. --- ports/unix/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/unix/main.c b/ports/unix/main.c index 5251fe8ae..c38b7b0c2 100644 --- a/ports/unix/main.c +++ b/ports/unix/main.c @@ -657,7 +657,7 @@ MP_NOINLINE int main_(int argc, char **argv) { inspect = true; } if (ret == NOTHING_EXECUTED || inspect) { - if (isatty(0)) { + if (isatty(0) || inspect) { prompt_read_history(); ret = do_repl(); prompt_write_history();