]> git.phdru.name Git - dotfiles.git/commitdiff
lib/python/init.py: fix Pager
authorOleg Broytman <phd@phdru.name>
Mon, 19 Sep 2016 20:19:41 +0000 (23:19 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 19 Sep 2016 20:19:41 +0000 (23:19 +0300)
lib/python/init.py

index 1697a08d38f364db2e2910a639cfc0ad68765697..9d20cd636a55c7a17bf0d9f8fcf65e44c7e7d5d2 100644 (file)
@@ -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: