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:
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: