From aec3bd392bae52e37f2235badf93ba1cd663d205 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Wed, 27 Jun 2007 18:15:37 +0000 Subject: [PATCH] sync remove torrent loop fix - aaron --- src/core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core.py b/src/core.py index 9254bed7d..22384f320 100644 --- a/src/core.py +++ b/src/core.py @@ -690,7 +690,9 @@ class Manager: # Add torrents to core and unique_IDs torrents_with_unique_ID = self.unique_IDs.values() - for torrent in self.state.torrents: + # loop through a temp list, so we can remove torrents without + # messing up iteration + for torrent in list(self.state.torrents): if not os.path.exists(torrent.filename): print "Missing file: %s" % torrent.filename self.state.torrents.remove(torrent)