[pygobject] add an exception type to the try/except block



commit 8f537ccd62f41ebe0db3853e2ae08080666f598f
Author: John (J5) Palmieri <johnp redhat com>
Date:   Wed Jun 23 12:02:04 2010 -0400

    add an exception type to the try/except block
    
    * we should always specify what exception types we are expecting

 gi/overrides/Gtk.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 9e26d74..14f72a4 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -57,7 +57,7 @@ class ActionGroup(Gtk.ActionGroup):
         """
         try:
             iter(entries)
-        except:
+        except (TypeError):
             raise TypeError('entries must be iterable')
 
         def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None):
@@ -102,7 +102,7 @@ class ActionGroup(Gtk.ActionGroup):
 
         try:
             iter(entries)
-        except:
+        except (TypeError):
             raise TypeError('entries must be iterable')
 
         def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None, is_active=False):
@@ -148,7 +148,7 @@ class ActionGroup(Gtk.ActionGroup):
         """
         try:
             iter(entries)
-        except:
+        except (TypeError):
             raise TypeError('entries must be iterable')
 
         first_action = None



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