| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5eed6af commit 2c0958f
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,6 +29,8 @@ | |||
| 29 | 29 | import sys | |
| 30 | 30 | import shlex | |
| 31 | 31 | ||
| 32 | + from bpython._py3compat import py3 | ||
| 33 | + | ||
| 32 | 34 | ||
| 33 | 35 | def get_pager_command(default='less -rf'): | |
| 34 | 36 | command = shlex.split(os.environ.get('PAGER', default)) | |
@@ -51,7 +53,7 @@ def page(data, use_internal=False): | |||
| 51 | 53 | curses.endwin() | |
| 52 | 54 | try: | |
| 53 | 55 | popen = subprocess.Popen(command, stdin=subprocess.PIPE) | |
| 54 | - if isinstance(data, unicode): | ||
| 56 | + if py3 or isinstance(data, unicode): | ||
| 55 | 57 | data = data.encode(sys.__stdout__.encoding, 'replace') | |
| 56 | 58 | popen.stdin.write(data) | |
| 57 | 59 | popen.stdin.close() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments