Skip to content

Commit c973e1e

Browse files
committed
refactor(pmjs): unify quitting by EOFError
`pyreadline3` on Windows would throw `Readline internal error` if calling `sys.exit` directly inside the REPL loop
1 parent 8989c41 commit c973e1e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

python/pythonmonkey/cli/pmjs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ def sigint_handler(signum, frame):
191191

192192
got_sigint = got_sigint + 1
193193
if (got_sigint > 1):
194-
sys.stdout.write("\n")
195-
quit()
194+
raise EOFError
196195

197196
if (inner_loop != True):
198197
if (got_sigint == 1 and len(readline.get_line_buffer()) == readline_skip_chars):

0 commit comments

Comments
 (0)