Skip to content

Commit d478a47

Browse files
committed
test: Fix combine_logs.py for AppVeyor build
1 parent 6288f15 commit d478a47

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/functional/combine_logs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import argparse
1010
from collections import defaultdict, namedtuple
11-
import glob
1211
import heapq
1312
import itertools
1413
import os
@@ -78,10 +77,11 @@ def read_logs(tmp_dir):
7877
for each of the input log files."""
7978

8079
# Find out what the folder is called that holds the debug.log file
81-
chain = glob.glob("{}/node0/*/debug.log".format(tmp_dir))
82-
if chain:
83-
chain = chain[0] # pick the first one if more than one chain was found (should never happen)
84-
chain = re.search(r'node0/(.+?)/debug\.log$', chain).group(1) # extract the chain name
80+
glob = pathlib.Path(tmp_dir).glob('node0/**/debug.log')
81+
path = next(glob, None)
82+
if path:
83+
assert next(glob, None) is None # more than one debug.log, should never happen
84+
chain = re.search(r'node0/(.+?)/debug\.log$', path.as_posix()).group(1) # extract the chain name
8585
else:
8686
chain = 'regtest' # fallback to regtest (should only happen when none exists)
8787

0 commit comments

Comments
 (0)