diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-07-02 14:58:11 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-07-02 15:05:01 +0200 |
commit | 01db8cfb69219a9283949e88c43a229b31cd4b0c (patch) | |
tree | 2195220748fd0f597af3977e40032e1e34ab6bb6 /scripts/asciidoc2html.py | |
parent | 68b245aa6f7143fe1e44ebe67bed6e317a9dc81b (diff) | |
download | qutebrowser-01db8cfb69219a9283949e88c43a229b31cd4b0c.tar.gz qutebrowser-01db8cfb69219a9283949e88c43a229b31cd4b0c.zip |
scripts: Clean up finding asciidoc in asciidoc2html
I've also tried to add asciidoc3 support, but with its asciidoc3.conf and
asciidoc3_postinstall which creates ~/asciidoc3 (!) it doesn't really seem like
a drop-in replacement.
Diffstat (limited to 'scripts/asciidoc2html.py')
-rwxr-xr-x | scripts/asciidoc2html.py | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py index e337c54db..f89ce86f9 100755 --- a/scripts/asciidoc2html.py +++ b/scripts/asciidoc2html.py @@ -218,21 +218,16 @@ class AsciiDoc: if self._asciidoc is not None: return self._asciidoc - try: - subprocess.run(['asciidoc'], stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, check=True) - except OSError: - pass - else: - return ['asciidoc'] - - try: - subprocess.run(['asciidoc.py'], stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, check=True) - except OSError: - pass - else: - return ['asciidoc.py'] + for executable in ['asciidoc', 'asciidoc.py']: + try: + subprocess.run([executable, '--version'], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + check=True) + except OSError: + pass + else: + return [executable] raise FileNotFoundError |