summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-02-09 22:25:26 +0100
committerhut <hut@lavabit.com>2012-02-09 22:25:26 +0100
commit5eed34cb880330cae45c6cfedad596a4c74700e5 (patch)
treef9c81db0303353ec13b6d204af709b3fac981326
parentf8b6ef7e55f20dbf1db9aea5e7b40444be413d69 (diff)
downloadranger-5eed34cb880330cae45c6cfedad596a4c74700e5.tar.gz
widgets/statusbar: Catch exceptions in env.get_free_space
-rw-r--r--ranger/gui/widgets/statusbar.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py
index 1a3b356e..1ffb9fa3 100644
--- a/ranger/gui/widgets/statusbar.py
+++ b/ranger/gui/widgets/statusbar.py
@@ -241,10 +241,14 @@ class StatusBar(Widget):
 				right.add(human_readable(sumsize, separator=''))
 			right.add("/" + str(len(target.marked_items)))
 		else:
-			right.add(human_readable(target.disk_usage, separator='') +
-					" sum, ")
-			right.add(human_readable(self.env.get_free_space( \
-					target.mount_path), separator='') + " free")
+			right.add(human_readable(target.disk_usage, separator='') + " sum")
+			try:
+				free = self.env.get_free_space(target.mount_path)
+			except OSError:
+				pass
+			else:
+				right.add(", ", "space")
+				right.add(human_readable(free, separator='') + " free")
 		right.add("  ", "space")
 
 		if target.marked_items: