X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=lib%2Fpython%2Finit.py;h=19f02346be99db0af56f66db21fa9813bb023760;hb=7bdecd4895c62dd84a2383a9cb1512ac3049632a;hp=1697a08d38f364db2e2910a639cfc0ad68765697;hpb=89b04ad56e3c4b9e3073c250bb525051c6f1405b;p=dotfiles.git diff --git a/lib/python/init.py b/lib/python/init.py index 1697a08..19f0234 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: @@ -262,10 +263,6 @@ def init(): builtins.x = _Exit() - # In Python 2.5+ exit and quit are objects - if isinstance(builtins.exit, str): - builtins.exit = builtins.quit = x # noqa: x is defined as _Exit - # print conten of a file class _Cat: