From 2db74d1b83872968e10f615903606d766a9f89c4 Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 2 Feb 2024 06:59:13 -0500 Subject: [PATCH] python3.6 support fix --- Client/bench.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Client/bench.py b/Client/bench.py index adc7a14..cabf62a 100644 --- a/Client/bench.py +++ b/Client/bench.py @@ -50,13 +50,13 @@ def parse_stream_output(stream): nps_pattern = r'(\d+\s+nps)|(nps\s+\d+)|(nodes second\s+\d+)' bench_pattern = r'(\d+\s+nodes)|(nodes\s+\d+)|(nodes searched\s+\d+)' - # Search for and set only once the NPS value - if (re_nps := re.search(nps_pattern, line, re.IGNORECASE)): - nps = nps if nps else re_nps.group() + # Search for and set only once the NPS and Bench values + re_nps = re.search(nps_pattern, line, re.IGNORECASE) + re_bench = re.search(bench_pattern, line, re.IGNORECASE) - # Search for and set only once the Bench value - if (re_bench := re.search(bench_pattern, line, re.IGNORECASE)): - bench = bench if bench else re_bench.group() + # Set, but don't override + if re_nps: nps = nps if nps else re_nps.group() + if re_bench: bench = bench if bench else re_bench.group() # Parse out the integer portion from our matches nps = int(re.search(r'\d+', nps ).group()) if nps else None