aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-09-14 16:16:15 +0200
committerAnton Khirnov <anton@khirnov.net>2022-09-14 16:16:15 +0200
commit777eb97d8ed42f4c7432fc8ee516e4704a9989e8 (patch)
tree1d99e061a6d25a1c12a7c0815266a988b0ed5915
parent2e5e247801a313603894529d0b44ca40f04d931e (diff)
Cleanly exit on KeyboardInterrupt.
-rwxr-xr-xfshare.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/fshare.py b/fshare.py
index 5e48e94..e1bc684 100755
--- a/fshare.py
+++ b/fshare.py
@@ -405,3 +405,6 @@ with contextlib.ExitStack() as stack:
except StateCorruptError:
logger.error('Corrupted state file')
sys.exit(1)
+ except KeyboardInterrupt:
+ logger.info('Interrupted, exiting')
+ sys.exit(0)