From b63cdf19f4691b3dfcab1fbad97c7289be568a03 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 12 Dec 2022 09:51:22 +0100 Subject: scripts: Show asciidoc errors while discovering --- scripts/asciidoc2html.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py index 1b904736d..291d48d5f 100755 --- a/scripts/asciidoc2html.py +++ b/scripts/asciidoc2html.py @@ -234,11 +234,16 @@ class AsciiDoc: for executable in ['asciidoc', 'asciidoc.py']: try: subprocess.run([executable, '--version'], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, + capture_output=True, + text=True, check=True) - except OSError: + except FileNotFoundError: pass + except OSError as e: + utils.print_error(f"While running {executable}: {e}") + except subprocess.CalledProcessError as e: + utils.print_error( + f"While running {executable}: {e}\n{e.stdout}\n{e.stderr}") else: return [executable] -- cgit v1.2.3-54-g00ecf