Skip to content

Commit 673b2c7

Browse files
committed
feat(pmjs): do not print out the whole Python traceback when hitting Ctrl-C
1 parent e3a8b0e commit 673b2c7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

python/pythonmonkey/cli/pmjs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,10 @@ async def runJS():
367367
globalInitModule.patchGlobalRequire()
368368
pm.runProgramModule(args[0], args, requirePath)
369369
await pm.wait() # blocks until all asynchronous calls finish
370-
asyncio.run(runJS())
370+
try:
371+
asyncio.run(runJS())
372+
except KeyboardInterrupt:
373+
print() # silently going to end the program instead of printing out the Python traceback
371374
elif (enterRepl or forceRepl):
372375
async def runREPL():
373376
globalInitModule.initReplLibs()

0 commit comments

Comments
 (0)