update-dbus-docs: skip test if python is too old
This commit is contained in:
parent
8aaf611b9a
commit
198fda4f48
|
@ -5,7 +5,6 @@ import argparse
|
||||||
import collections
|
import collections
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import shlex
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import io
|
import io
|
||||||
|
|
||||||
|
@ -14,6 +13,11 @@ try:
|
||||||
except ModuleNotFoundError as e:
|
except ModuleNotFoundError as e:
|
||||||
etree = e
|
etree = e
|
||||||
|
|
||||||
|
try:
|
||||||
|
from shlex import join as shlex_join
|
||||||
|
except ImportError as e:
|
||||||
|
shlex_join = e
|
||||||
|
|
||||||
class NoCommand(Exception):
|
class NoCommand(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -183,7 +187,7 @@ def subst_output(document, programlisting, stats):
|
||||||
interface = programlisting.get('interface')
|
interface = programlisting.get('interface')
|
||||||
|
|
||||||
argv = [f'{opts.build_dir}/{executable}', f'--bus-introspect={interface}']
|
argv = [f'{opts.build_dir}/{executable}', f'--bus-introspect={interface}']
|
||||||
print(f'COMMAND: {shlex.join(argv)}')
|
print(f'COMMAND: {shlex_join(argv)}')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
out = subprocess.check_output(argv, text=True)
|
out = subprocess.check_output(argv, text=True)
|
||||||
|
@ -293,8 +297,9 @@ def parse_args():
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
opts = parse_args()
|
opts = parse_args()
|
||||||
|
|
||||||
if isinstance(etree, Exception):
|
for item in (etree, shlex_join):
|
||||||
print(etree, file=sys.stderr)
|
if isinstance(item, Exception):
|
||||||
|
print(item, file=sys.stderr)
|
||||||
exit(77 if opts.test else 1)
|
exit(77 if opts.test else 1)
|
||||||
|
|
||||||
if not os.path.exists(f'{opts.build_dir}/systemd'):
|
if not os.path.exists(f'{opts.build_dir}/systemd'):
|
||||||
|
|
Loading…
Reference in a new issue