about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-11-05 21:51:10 +0100
committerhut <hut@lavabit.com>2012-11-05 21:51:10 +0100
commit0760b062b9f6822adddd815b7451775f8e54dc05 (patch)
treeb4313aebd88f42a0532687beed8fca9699583ed9
parent7ff2121eff2590a11ad623be9bb2c48010630187 (diff)
downloadranger-0760b062b9f6822adddd815b7451775f8e54dc05.tar.gz
widgets.browserview: catch an error in _draw_borders
-rw-r--r--ranger/gui/widgets/browserview.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py
index 3bfaf3fd..7dd0a95d 100644
--- a/ranger/gui/widgets/browserview.py
+++ b/ranger/gui/widgets/browserview.py
@@ -2,7 +2,7 @@
 # This software is distributed under the terms of the GNU GPL version 3.
 
 """The BrowserView manages a set of BrowserColumns."""
-import curses
+import curses, _curses
 from ranger.ext.signals import Signal
 from ranger.ext.keybinding_parser import key_to_string
 from . import Widget
@@ -138,10 +138,13 @@ class BrowserView(Widget, DisplayableContainer):
 			if right_end < left_start:
 				right_end = self.wid - 1
 
-		win.hline(0, left_start, curses.ACS_HLINE, right_end - left_start)
-		win.hline(self.hei - 1, left_start, curses.ACS_HLINE,
-				right_end - left_start)
-		win.vline(1, left_start, curses.ACS_VLINE, self.hei - 2)
+		try:
+			win.hline(0, left_start, curses.ACS_HLINE, right_end - left_start)
+			win.hline(self.hei - 1, left_start, curses.ACS_HLINE,
+					right_end - left_start)
+			win.vline(1, left_start, curses.ACS_VLINE, self.hei - 2)
+		except _curses.error:
+			pass
 
 		for child in self.columns:
 			if not child.has_preview():