diff options
Diffstat (limited to 'guix/scripts/package.scm')
-rw-r--r-- | guix/scripts/package.scm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 5c6a118560..094d348ac9 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -307,13 +307,15 @@ return its return value." (force-output (current-error-port)) (call-with-sigint-handler (lambda () - (let ((result exp)) - ;; Clear the line. - (display #\cr (current-error-port)) - (display blank (current-error-port)) - (display #\cr (current-error-port)) - (force-output (current-error-port)) - exp)) + (dynamic-wind + (const #f) + (lambda () exp) + (lambda () + ;; Clear the line. + (display #\cr (current-error-port)) + (display blank (current-error-port)) + (display #\cr (current-error-port)) + (force-output (current-error-port))))) (lambda (signum) (format (current-error-port) " interrupted by signal ~a~%" SIGINT) #f)))) |