Merge pull request #18395 from bluca/make_docs_img_clean

Add Python 3.7 compat in update-dbus-docs and fix regression in integration tests 'make clean'
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-01-29 14:07:54 +01:00
committed by GitHub
2 changed files with 15 additions and 3 deletions
+4
View File
@@ -2088,6 +2088,10 @@ _test_cleanup() {
set +e
_umount_dir $initdir
rm -vf "$IMAGE_PUBLIC"
# If multiple setups/cleans are ran in parallel, this can cause a race
if [ ${TEST_PARALLELIZE} -ne 1 ]; then
rm -vf "${IMAGESTATEDIR}/default.img"
fi
rm -vfr "$TESTDIR"
rm -vf "$STATEFILE"
) || :
+11 -3
View File
@@ -18,6 +18,11 @@ try:
except ImportError as e:
shlex_join = e
try:
from shlex import quote as shlex_quote
except ImportError as e:
shlex_quote = e
class NoCommand(Exception):
pass
@@ -186,7 +191,10 @@ def subst_output(document, programlisting, stats):
interface = programlisting.get('interface')
argv = [f'{opts.build_dir}/{executable}', f'--bus-introspect={interface}']
print(f'COMMAND: {shlex_join(argv)}')
if isinstance(shlex_join, Exception):
print(f'COMMAND: {" ".join(shlex_quote(arg) for arg in argv)}')
else:
print(f'COMMAND: {shlex_join(argv)}')
try:
out = subprocess.check_output(argv, text=True)
@@ -296,7 +304,7 @@ def parse_args():
if __name__ == '__main__':
opts = parse_args()
for item in (etree, shlex_join):
for item in (etree, shlex_quote):
if isinstance(item, Exception):
print(item, file=sys.stderr)
exit(77 if opts.test else 1)
@@ -308,7 +316,7 @@ if __name__ == '__main__':
# Let's print all statistics at the end
mlen = max(len(page) for page in stats)
total = sum((item['stats'] for item in stats.values()), start=collections.Counter())
total = sum((item['stats'] for item in stats.values()), collections.Counter())
total = 'total', dict(stats=total, outdated=False)
outdated = []
for page, info in sorted(stats.items()) + [total]: