[d-feet/pygi] Replace "except Exception, e" with "except Exception as e"
- From: Thomas Bechtold <toabctl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [d-feet/pygi] Replace "except Exception, e" with "except Exception as e"
- Date: Mon, 15 Oct 2012 15:46:36 +0000 (UTC)
commit df5276c939a7adb70bbfe3f13c913610878600a6
Author: Thomas Bechtold <thomasbechtold jpberlin de>
Date: Tue Oct 9 19:53:41 2012 +0200
Replace "except Exception, e" with "except Exception as e"
dfeet/DFeetApp.py | 2 +-
dfeet/_ui/addconnectiondialog.py | 2 +-
dfeet/_ui/executemethoddialog.py | 4 ++--
dfeet/bus_watch.py | 2 +-
dfeet/introspection.py | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/dfeet/DFeetApp.py b/dfeet/DFeetApp.py
index 6e88c1d..426fb46 100644
--- a/dfeet/DFeetApp.py
+++ b/dfeet/DFeetApp.py
@@ -112,7 +112,7 @@ class DFeetApp:
# Truncating history
if (len(self.bus_history) > self.HISTORY_MAX_SIZE):
self.bus_history = self.bus_history[0:self.HISTORY_MAX_SIZE]
- except Exception, e:
+ except Exception as e:
print "can not connect to '%s': %s" % (address, str(e))
dialog.destroy()
diff --git a/dfeet/_ui/addconnectiondialog.py b/dfeet/_ui/addconnectiondialog.py
index 643d2d0..82ddafc 100644
--- a/dfeet/_ui/addconnectiondialog.py
+++ b/dfeet/_ui/addconnectiondialog.py
@@ -44,7 +44,7 @@ class AddConnectionDialog:
#check if given address is valid
try:
is_supported = Gio.dbus_is_supported_address(self.address)
- except Exception, e:
+ except Exception as e:
self.label_status.set_text(str(e))
self.run()
else:
diff --git a/dfeet/_ui/executemethoddialog.py b/dfeet/_ui/executemethoddialog.py
index d7e525e..48c8eaf 100644
--- a/dfeet/_ui/executemethoddialog.py
+++ b/dfeet/_ui/executemethoddialog.py
@@ -78,7 +78,7 @@ class ExecuteMethodDialog:
#self.connection.call(None, object_path, self.method_obj.iface_obj.iface_info.name, self.method_obj.method_info.name, params_gvariant, GLib.VariantType.new("(s)"), Gio.DBusCallFlags.NONE, -1, None)
- except Exception, e:
+ except Exception as e:
#output the exception
self.source_textview.get_buffer().set_text(str(e))
self.prettyprint_textview.get_buffer().set_text(pformat(str(e)))
@@ -106,7 +106,7 @@ class ExecuteMethodDialog:
self.prettyprint_textview.get_buffer().set_text(str(result.unpack()[0]))
else:
self.prettyprint_textview.get_buffer().set_text('This method did not return anything')
- except Exception, e:
+ except Exception as e:
#output the exception
self.source_textview.get_buffer().set_text(str(e))
self.prettyprint_textview.get_buffer().set_text(pformat(str(e)))
diff --git a/dfeet/bus_watch.py b/dfeet/bus_watch.py
index 1264adb..56a8e8b 100644
--- a/dfeet/bus_watch.py
+++ b/dfeet/bus_watch.py
@@ -38,7 +38,7 @@ class DBusBusName(GObject.GObject):
self.__pid = pid_new
try:
self.__update_cmdline()
- except Exception, e:
+ except Exception as e:
self.__cmdline = ''
@property
diff --git a/dfeet/introspection.py b/dfeet/introspection.py
index c22e0cd..5890931 100644
--- a/dfeet/introspection.py
+++ b/dfeet/introspection.py
@@ -135,7 +135,7 @@ class AddressInfo():
"""callback when Introspect dbus function call finished"""
try:
res = connection.call_finish(result_async)
- except Exception, e:
+ except Exception as e:
#got an exception (eg dbus timeout). show the exception
print "Exception: '%s'" % (str(e))
self.__messagedialog.set_title("DBus Exception")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]