From 80acd38e14ace64417400d45c68e1d06630b514c Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 2 Mar 2020 22:11:20 +0100 Subject: [PATCH] Use (recv/send)_butes instead of recv/send This commit improves a bit the performances in the same spirit as b91ad83 --- pythonfuzz/fuzzer.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pythonfuzz/fuzzer.py b/pythonfuzz/fuzzer.py index 1e27391..bd88854 100644 --- a/pythonfuzz/fuzzer.py +++ b/pythonfuzz/fuzzer.py @@ -46,7 +46,7 @@ def write(self, x): child_conn.send(e) break else: - child_conn.send(tracer.get_coverage()) + child_conn.send_bytes(b'%d' % tracer.get_coverage()) class Fuzzer(object): @@ -135,8 +135,9 @@ def start(self): self.write_sample(buf, prefix='timeout-') break - total_coverage = parent_conn.recv() - if type(total_coverage) != int: + try: + total_coverage = int(parent_conn.recv_bytes()) + except ValueError: self.write_sample(buf) break