diff --git a/deluge/core/core.py b/deluge/core/core.py index 0a97176cf..acda40a42 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -363,8 +363,8 @@ class Core(component.Component): for torrent_id in torrent_ids: try: self.torrentmanager.remove(torrent_id, remove_data=remove_data, save_state=False) - except InvalidTorrentError, ite: - errors.append((torrent_id, ite)) + except InvalidTorrentError as ex: + errors.append((torrent_id, ex)) # Save the session state self.torrentmanager.save_state() return errors diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/gtkui.py b/deluge/plugins/Blocklist/deluge/plugins/blocklist/gtkui.py index 016dd5150..043410d70 100644 --- a/deluge/plugins/Blocklist/deluge/plugins/blocklist/gtkui.py +++ b/deluge/plugins/Blocklist/deluge/plugins/blocklist/gtkui.py @@ -28,11 +28,7 @@ class GtkUI(GtkPluginBase): log.debug("Blocklist GtkUI enable..") self.plugin = component.get("PluginManager") - try: - self.load_preferences_page() - except Exception as err: - log.exception(err) - raise + self.load_preferences_page() self.status_item = component.get("StatusBar").add_item( image=common.get_resource("blocklist16.png"), @@ -200,10 +196,10 @@ class GtkUI(GtkPluginBase): try: ip = common.IP.parse(new_text) model.set(model.get_iter_from_string(path_string), 0, ip.address) - except common.BadIP as e: + except common.BadIP as ex: model.remove(model.get_iter_from_string(path_string)) from deluge.ui.gtkui import dialogs - d = dialogs.ErrorDialog(_("Bad IP address"), e.message) + d = dialogs.ErrorDialog(_("Bad IP address"), ex.message) d.run() def on_whitelist_treeview_selection_changed(self, selection): diff --git a/deluge/ui/console/modes/add_util.py b/deluge/ui/console/modes/add_util.py index e905f2193..ed4d18bb6 100644 --- a/deluge/ui/console/modes/add_util.py +++ b/deluge/ui/console/modes/add_util.py @@ -70,8 +70,8 @@ def add_torrent(t_file, options, success_cb, fail_cb, ress): try: TorrentInfo(f) - except Exception as e: - fail_cb(e.message, f, ress) + except Exception as ex: + fail_cb(ex.message, f, ress) continue filename = os.path.split(f)[-1]