[meld] Rework existing exception raising for future compatibility



commit 96e34ccf17beaf3aa2859c84bc508639af6b242e
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Mon Jun 11 08:27:42 2012 +1000

    Rework existing exception raising for future compatibility
    
    This commit changes our few comma-based raise statements to use the
    constructor form instead to match PEP 3109, improving Python 3
    compatibility.

 meld/meldapp.py               |    2 +-
 meld/ui/emblemcellrenderer.py |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/meld/meldapp.py b/meld/meldapp.py
index c4adf3c..7a944a6 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -88,7 +88,7 @@ class FilterEntry(object):
         elif filter_type == FilterEntry.SHELL:
             compiled = FilterEntry._compile_shell_pattern(filter_string)
         else:
-            raise ValueError, "Unknown filter type"
+            raise ValueError("Unknown filter type")
         return compiled
 
     def __copy__(self):
diff --git a/meld/ui/emblemcellrenderer.py b/meld/ui/emblemcellrenderer.py
index 283360b..079ea7d 100644
--- a/meld/ui/emblemcellrenderer.py
+++ b/meld/ui/emblemcellrenderer.py
@@ -57,7 +57,7 @@ class EmblemCellRenderer(gtk.GenericCellRenderer):
             else:
                 self._tint_color = None
         else:
-            raise AttributeError, "unknown property %s" % name
+            raise AttributeError("unknown property %s" % name)
 
     def do_get_property(self, pspec):
         if pspec.name == "icon-name":
@@ -67,7 +67,7 @@ class EmblemCellRenderer(gtk.GenericCellRenderer):
         elif pspec.name == "icon-tint":
             return self._icon_tint
         else:
-            raise AttributeError, "unknown property %s" % name
+            raise AttributeError("unknown property %s" % name)
 
     def on_render(self, window, widget, background_area, cell_area,
                   expose_area, flags):



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