From 4c441cd4be6ccb740cafea910766622ebea6d306 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 19 Sep 2016 23:19:41 +0300 Subject: [PATCH] lib/python/init.py: fix Pager --- lib/python/init.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/python/init.py b/lib/python/init.py index 1697a08..9d20cd6 100644 --- a/lib/python/init.py +++ b/lib/python/init.py @@ -152,16 +152,17 @@ def init(): except ImportError: class Pager(BasePager): def __init__(self): - self.pipe = Popen(pager, shell=True, stdin=PIPE) + self.stdout = os.popen(pager, 'w') + else: + class Pager(BasePager): + def __init__(self): + self.pipe = Popen(pager, shell=True, stdin=PIPE, + universal_newlines=True) self.stdout = self.pipe.stdin def close(self): BasePager.close(self) self.pipe.wait() - else: - class Pager(BasePager): - def __init__(self): - self.stdout = os.popen(pager, 'w') def displayhook(value): if value is not None: -- 2.39.2