Fix exception handling
This commit is contained in:
parent
c480132fa2
commit
42118932f2
|
@ -598,7 +598,7 @@ class TorrentManager(component.Component):
|
||||||
# Remove the torrent from deluge's session
|
# Remove the torrent from deluge's session
|
||||||
try:
|
try:
|
||||||
del self.torrents[torrent_id]
|
del self.torrents[torrent_id]
|
||||||
except KeyError, ValueError:
|
except (KeyError, ValueError):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Save the session state
|
# Save the session state
|
||||||
|
|
|
@ -516,7 +516,7 @@ class TorrentView(listview.ListView, component.Component):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return torrent_ids
|
return torrent_ids
|
||||||
except ValueError, TypeError:
|
except (ValueError, TypeError):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def get_torrent_status(self, torrent_id):
|
def get_torrent_status(self, torrent_id):
|
||||||
|
|
Loading…
Reference in New Issue