From 3eac51fa7beb8e7cae657c394c2de52f3f47ef12 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Thu, 8 Jul 2010 17:14:20 +0200 Subject: Catch keyboard interrupts (Ctrl+C) --- CHANGES | 7 +++++++ layman/overlays/source.py | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 0ef1408..9e4d793 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,13 @@ CHANGES ------- +Version TODO +=================================== + + - Fixed: Catch keyboard interrupts (Ctrl+C) while + running child processes properly + + Version 1.4.0 - Released 2010-07-08 =================================== diff --git a/layman/overlays/source.py b/layman/overlays/source.py index 9836526..2c039c9 100644 --- a/layman/overlays/source.py +++ b/layman/overlays/source.py @@ -148,7 +148,11 @@ class OverlaySource(object): # Make child non-interactive proc.stdin.close() - result = proc.wait() + try: + result = proc.wait() + except KeyboardInterrupt: + OUT.info('Interrupted manually', 2) + result = 1 if self.quiet: output_target.close() -- cgit v1.2.3-1-g7c22