[pitivi: 92/94] Make the removePreset method more strict about exceptions



commit bb0db0a812492f6c49c794547053da5c92d31ecf
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Sat Sep 10 21:32:09 2011 -0400

    Make the removePreset method more strict about exceptions

 pitivi/ui/preset.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/ui/preset.py b/pitivi/ui/preset.py
index 5d61c80..7796c8b 100644
--- a/pitivi/ui/preset.py
+++ b/pitivi/ui/preset.py
@@ -243,8 +243,11 @@ class PresetManager(object):
     def removePreset(self, name):
         try:
             os.remove(self.presets[name]["filepath"])  # Deletes json file if exists
+        except KeyError:
+            # Trying to remove a preset that has not actually been saved
+            return
         except Exception:
-            pass
+            raise
         self.presets.pop(name)
         for i, row in enumerate(self.ordered):
             if row[0] == name:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]