diff options
author | Marcos Pinto <markybob@dipconsultants.com> | 2007-11-26 17:03:04 +0000 |
---|---|---|
committer | Marcos Pinto <markybob@dipconsultants.com> | 2007-11-26 17:03:04 +0000 |
commit | d288e39a54593f375485c634999d53e8f98b708c (patch) | |
tree | eccbbfb4428717d61063856904b3b84afdbb4e6b | |
parent | 8c5355498c3f1be675ee9479f8fa6b31d881a165 (diff) | |
download | deluge-d288e39a54593f375485c634999d53e8f98b708c.tar.gz deluge-d288e39a54593f375485c634999d53e8f98b708c.tar.bz2 deluge-d288e39a54593f375485c634999d53e8f98b708c.zip |
tweak try/catch again
-rw-r--r-- | src/deluge_core.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp index f4adc83d7..4de7e2bf8 100644 --- a/src/deluge_core.cpp +++ b/src/deluge_core.cpp @@ -182,10 +182,10 @@ long get_torrent_index(torrent_handle &handle) long get_index_from_unique_ID(long unique_ID) { try{ - for (unsigned long i = 0; i < M_torrents->size(); i++) - if ((*M_torrents)[i].unique_ID == unique_ID) - return i; - RAISE_INT(DelugeError, "No such unique_ID."); + for (unsigned long i = 0; i < M_torrents->size(); i++) + if ((*M_torrents)[i].unique_ID == unique_ID) + return i; + RAISE_INT(DelugeError, "No such unique_ID."); } catch(invalid_handle&) { @@ -1802,11 +1802,11 @@ static PyObject *torrent_replace_trackers(PyObject *self, PyObject *args) const char* tracker; if (!PyArg_ParseTuple(args, "iz", &unique_ID, &tracker)) return NULL; - long index = get_index_from_unique_ID(unique_ID); - if (PyErr_Occurred()) - return NULL; try { + long index = get_index_from_unique_ID(unique_ID); + if (PyErr_Occurred()) + return NULL; if (M_torrents->at(index).handle.is_valid()){ std::vector<libtorrent::announce_entry> trackerlist; std::istringstream trackers(tracker); |