diff options
author | nfnty <git@nfnty.se> | 2017-02-14 23:26:55 +0100 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2017-02-14 23:26:55 +0100 |
commit | 874ef5c0125176f8a4ddef161477c0971372ebfd (patch) | |
tree | b3143db30c76670f51e390e4ca58883765464275 /ranger | |
parent | 50b6711b7832d52212844bd08d785007640a89ea (diff) | |
download | ranger-874ef5c0125176f8a4ddef161477c0971372ebfd.tar.gz |
ext.img_display.Iterm2ImageDisplayer.draw: Fix `TypeError`
Fixes #807
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/ext/img_display.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py index d8d0b20b..a6099236 100644 --- a/ranger/ext/img_display.py +++ b/ranger/ext/img_display.py @@ -210,7 +210,11 @@ class ITerm2ImageDisplayer(ImageDisplayer, FileManagerAware): def draw(self, path, start_x, start_y, width, height): curses.putp(curses.tigetstr("sc")) - sys.stdout.write(curses.tparm(curses.tigetstr("cup"), start_y, start_x)) + tparm = curses.tparm(curses.tigetstr("cup"), start_y, start_x) + if sys.version_info[0] < 3: + sys.stdout.write(tparm) + else: + sys.stdout.buffer.write(tparm) sys.stdout.write(self._generate_iterm2_input(path, width, height)) curses.putp(curses.tigetstr("rc")) sys.stdout.flush() |