From 2bf97e0faf2d409a9eb7b87454195a7a4ba40c1f Mon Sep 17 00:00:00 2001 From: Gabriel Studer <gabriel.studer@unibas.ch> Date: Mon, 16 Dec 2019 15:10:10 +0100 Subject: [PATCH] use buffered stdout in compare-structures --- actions/ost-compare-structures | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/actions/ost-compare-structures b/actions/ost-compare-structures index e884b7bad..60a2b8c95 100644 --- a/actions/ost-compare-structures +++ b/actions/ost-compare-structures @@ -989,20 +989,6 @@ def _Main(): with open(opts.output, "w") as outfile: json.dump(result, outfile, indent=4, sort_keys=True) -class _Unbuffered(object): - # https://stackoverflow.com/questions/45263064/how-can-i-fix-this-valueerror-cant-have-unbuffered-text-i-o-in-python-3/45263101 - def __init__(self, stream): - self.stream = stream - def write(self, data): - self.stream.write(data) - self.stream.flush() - def writelines(self, datas): - self.stream.writelines(datas) - self.stream.flush() - def __getattr__(self, attr): - return getattr(self.stream, attr) - if __name__ == '__main__': - # make script 'hot' - sys.stdout = _Unbuffered(sys.stdout) _Main() + -- GitLab