python3.6 support fix
This commit is contained in:
1 parent
732e7b1d61
commit
2db74d1b83
1 file changed
+6
-6
+6
-6
@@ -50,13 +50,13 @@ def parse_stream_output(stream):
|
|||||||
nps_pattern = r'(\d+\s+nps)|(nps\s+\d+)|(nodes second\s+\d+)'
|
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+)'
|
bench_pattern = r'(\d+\s+nodes)|(nodes\s+\d+)|(nodes searched\s+\d+)'
|
||||||
|
|
||||||
# Search for and set only once the NPS value
|
# Search for and set only once the NPS and Bench values
|
||||||
if (re_nps := re.search(nps_pattern, line, re.IGNORECASE)):
|
re_nps = re.search(nps_pattern, line, re.IGNORECASE)
|
||||||
nps = nps if nps else re_nps.group()
|
re_bench = re.search(bench_pattern, line, re.IGNORECASE)
|
||||||
|
|
||||||
# Search for and set only once the Bench value
|
# Set, but don't override
|
||||||
if (re_bench := re.search(bench_pattern, line, re.IGNORECASE)):
|
if re_nps: nps = nps if nps else re_nps.group()
|
||||||
bench = bench if bench else re_bench.group()
|
if re_bench: bench = bench if bench else re_bench.group()
|
||||||
|
|
||||||
# Parse out the integer portion from our matches
|
# Parse out the integer portion from our matches
|
||||||
nps = int(re.search(r'\d+', nps ).group()) if nps else None
|
nps = int(re.search(r'\d+', nps ).group()) if nps else None
|
||||||
|
|||||||
Reference in new issue
Block a user