summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2022-12-12 09:51:22 +0100
committerFlorian Bruhin <me@the-compiler.org>2022-12-12 09:51:22 +0100
commitb63cdf19f4691b3dfcab1fbad97c7289be568a03 (patch)
treed83d8fc52a8e5c7b73e83cd4c7ba072000d95c4b
parent4c9050d4be4f813e79b71ade28c7d71920851ed0 (diff)
downloadqutebrowser-b63cdf19f4691b3dfcab1fbad97c7289be568a03.tar.gz
qutebrowser-b63cdf19f4691b3dfcab1fbad97c7289be568a03.zip
scripts: Show asciidoc errors while discovering
-rwxr-xr-xscripts/asciidoc2html.py11
1 files 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]