From 066a293462b0a9042073889b376a3fb93e5d5a20 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Wed, 12 Jun 2019 13:55:43 -0700 Subject: [PATCH] If verbose, print stacktrace on KeyboardInterrupt --- src/ocrmypdf/_sync.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ocrmypdf/_sync.py b/src/ocrmypdf/_sync.py index 013be469..a9f22294 100644 --- a/src/ocrmypdf/_sync.py +++ b/src/ocrmypdf/_sync.py @@ -330,7 +330,10 @@ def run_pipeline(options, api=False): # Execute the pipeline exec_concurrent(context) except (KeyboardInterrupt if not api else NeverRaise) as e: - log.error("KeyboardInterrupt") + if options.verbose >= 1: + log.exception("KeyboardInterrupt") + else: + log.error("KeyboardInterrupt") return ExitCode.ctrl_c except (ExitCodeException if not api else NeverRaise) as e: if str(e):