aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/linereader.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/linereader.py')
-rw-r--r--src/plugins/linereader.py4
1 files changed, 3 insertions, 1 deletions
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):