Skip to content

Commit 0fb6059

Browse files
committed
Handle KeyboardInterrupt in REPL
1 parent c9cdad8 commit 0fb6059

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pysrc/juliacall/__main__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@
1111
while True:
1212
try:
1313
line = input(f"{GREEN}juliacall> {RESET}")
14+
except KeyboardInterrupt:
15+
print("\n")
16+
continue
1417
except EOFError:
1518
break
1619
if not line.strip():
1720
continue
1821
try:
1922
result = Main.seval(line)
2023
if result is not None:
21-
print(result)
24+
Main.display(result)
25+
print()
2226
except Exception as e:
2327
print(f"{RED}ERROR:{RESET} {e}")
2428

0 commit comments

Comments
 (0)