From 5eed34cb880330cae45c6cfedad596a4c74700e5 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 9 Feb 2012 22:25:26 +0100 Subject: widgets/statusbar: Catch exceptions in env.get_free_space --- ranger/gui/widgets/statusbar.py | 12 ++++++++---- 1 file 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: -- cgit 1.4.1-2-gfad0