From: Clifford Wolf Date: Mon, 13 Feb 2017 15:59:34 +0000 (+0100) Subject: Fix readline() handling for partial lines X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=221018b19dd55c9700fa75661e6f7ff3f275acd8;p=SymbiYosys.git Fix readline() handling for partial lines --- diff --git a/sbysrc/sby_core.py b/sbysrc/sby_core.py index d53d7d6..a1aaec3 100644 --- a/sbysrc/sby_core.py +++ b/sbysrc/sby_core.py @@ -35,6 +35,7 @@ class SbyTask: self.logfile = logfile self.noprintregex = None self.notify = [] + self.linebuffer = "" for dep in self.deps: dep.register_dep(self) @@ -95,7 +96,11 @@ class SbyTask: while True: outs = self.p.stdout.readline().decode("utf-8") if len(outs) == 0: break - outs = outs.strip() + if outs[-1] != '\n': + self.linebuffer += outs + break + outs = (self.linebuffer + outs).strip() + self.linebuffer = "" if len(outs) == 0: continue if self.noprintregex is None or not self.noprintregex.match(outs): self.job.log("%s: %s" % (self.info, outs))