diff options
author | Martin Zumsande <mzumsande@gmail.com> | 2019-09-26 23:26:39 +0200 |
---|---|---|
committer | Martin Zumsande <mzumsande@gmail.com> | 2019-09-27 12:40:20 +0200 |
commit | d478a472eb0d666e8a762ed8d24fafbabc5f94f3 (patch) | |
tree | a421e899987820d223bfbcd4100dcf2ef0a95a17 | |
parent | 6288f15f50ab98b336ab86804c4cbea3807dc1d3 (diff) | |
download | bitcoin-d478a472eb0d666e8a762ed8d24fafbabc5f94f3.tar.xz |
test: Fix combine_logs.py for AppVeyor build
-rwxr-xr-x | test/functional/combine_logs.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/functional/combine_logs.py b/test/functional/combine_logs.py index 367d0f6916..a70d9c4ac1 100755 --- a/test/functional/combine_logs.py +++ b/test/functional/combine_logs.py @@ -8,7 +8,6 @@ If no argument is provided, the most recent test directory will be used.""" import argparse from collections import defaultdict, namedtuple -import glob import heapq import itertools import os @@ -78,10 +77,11 @@ def read_logs(tmp_dir): for each of the input log files.""" # Find out what the folder is called that holds the debug.log file - chain = glob.glob("{}/node0/*/debug.log".format(tmp_dir)) - if chain: - chain = chain[0] # pick the first one if more than one chain was found (should never happen) - chain = re.search(r'node0/(.+?)/debug\.log$', chain).group(1) # extract the chain name + glob = pathlib.Path(tmp_dir).glob('node0/**/debug.log') + path = next(glob, None) + if path: + assert next(glob, None) is None # more than one debug.log, should never happen + chain = re.search(r'node0/(.+?)/debug\.log$', path.as_posix()).group(1) # extract the chain name else: chain = 'regtest' # fallback to regtest (should only happen when none exists) |