Skip to content

Commit

Permalink
Exit clean from KeyboardInterrupt also
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberrumor committed Mar 12, 2024
1 parent f82510c commit 96e8dab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ammo/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def help(self):
print(out)
try:
input("[Enter] ")
except EOFError:
except (KeyboardInterrupt, EOFError):
print()
sys.exit(0)

Expand Down Expand Up @@ -322,10 +322,10 @@ def repl(self):
try:
if not (stdin := input(f"{self.controller._prompt()}")):
continue
except EOFError:
except (KeyboardInterrupt, EOFError):
print()
sys.exit(0)

cmds = stdin.split()
args = [] if len(cmds) <= 1 else cmds[1:]
func = cmds[0]
Expand Down Expand Up @@ -387,4 +387,4 @@ def repl(self):

except Warning as warning:
print(f"\n{warning}")
input("[Enter] ")
input("[Enter] ")

0 comments on commit 96e8dab

Please sign in to comment.