Browse code

Use python 3 / 2.6 exception syntax.

corentin.labbe authored on 12/05/2013 07:52:19 • José Fonseca committed on 12/05/2013 07:52:19
Showing 1 changed files

  • xdot.py index 904ef74..61e4d8b 100755
... ...
@@ -1475,7 +1475,7 @@ class DotWidget(gtk.DrawingArea):
1475 1475
             return False
1476 1476
         try:
1477 1477
             self.set_xdotcode(xdotcode)
1478
-        except ParseError, ex:
1478
+        except ParseError as ex:
1479 1479
             dialog = gtk.MessageDialog(type=gtk.MESSAGE_ERROR,
1480 1480
                                        message_format=str(ex),
1481 1481
                                        buttons=gtk.BUTTONS_OK)
... ...
@@ -1880,7 +1880,7 @@ class DotWindow(gtk.Window):
1880 1880
             fp = file(filename, 'rt')
1881 1881
             self.set_dotcode(fp.read(), filename)
1882 1882
             fp.close()
1883
-        except IOError, ex:
1883
+        except IOError as ex:
1884 1884
             dlg = gtk.MessageDialog(type=gtk.MESSAGE_ERROR,
1885 1885
                                     message_format=str(ex),
1886 1886
                                     buttons=gtk.BUTTONS_OK)