diff --git a/test/functional/combine_logs.py b/test/functional/combine_logs.py --- a/test/functional/combine_logs.py +++ b/test/functional/combine_logs.py @@ -8,7 +8,6 @@ import argparse from collections import defaultdict, namedtuple -import glob import heapq import itertools import os @@ -86,13 +85,14 @@ 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: - # pick the first one if more than one chain was found (should never - # happen) - chain = chain[0] + glob = pathlib.Path(tmp_dir).glob('node0/**/debug.log') + path = next(glob, None) + if path: + # more than one debug.log should never happen + assert next(glob, None) is None # extract the chain name - chain = re.search(r'node0/(.+?)/debug\.log$', chain).group(1) + chain = re.search(r'node0/(.+?)/debug\.log$', + path.as_posix()).group(1) else: # fallback to regtest (should only happen when none exists) chain = 'regtest'