Skip to content

Commit

Permalink
✨ feat: handle KeyboardInterrupt gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
welpo committed Dec 27, 2024
1 parent 37c692e commit 2ad3af4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions shuku/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1318,5 +1318,9 @@ def pluralize(count: int, singular: str, plural: Optional[str] = None) -> str:
return singular if count == 1 else plural


if __name__ == "__main__":
main() # pragma: no cover
if __name__ == "__main__": # pragma: no cover
try:
main()
except KeyboardInterrupt as e:
logging.info("Operation cancelled by user.")
sys.exit(130)

0 comments on commit 2ad3af4

Please sign in to comment.