From 040cd0ddc3256b1e4b7950abb8a5d60b2a80f2fd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 13 Jun 2014 17:26:07 +0200 Subject: fix line reader and add kmsg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/plugins/linereader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/plugins/linereader.py') diff --git a/src/plugins/linereader.py b/src/plugins/linereader.py index 643d7f9..103d15f 100644 --- a/src/plugins/linereader.py +++ b/src/plugins/linereader.py @@ -42,9 +42,11 @@ class LineReader: if isinstance(channel, str): self.__channel = channel = os.open(channel, os.O_RDONLY) if isinstance(channel, int): - next__ = lambda : channel.read() + channel = os.fdopen(channel) + next__ = lambda : channel.read(1) buffer = '' def next_(): + nonlocal buffer while True: got = next__() if (got is None) or (len(got) == 0): -- cgit v1.2.3-70-g09d2